The contents of my clipboard are a series of 10 words separated by spaces. I would like to paste them into an application which requires each word to be entered individually into text boxes, where you can navigate to the next text box by pressing the Tab key.
How can I create an Automator script to split the contents of my clipboard on space, and then paste each word followed by the tab key?
Best Answer
You can use a Run AppleScript action in an Automator workflow to accomplish this.
Example AppleScript code:
Notes:
If you really want to paste the words instead of typing, then use the following example AppleScript code instead:
Note: The example AppleScript code is just that and sans any included error handling does not contain any additional error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors. Additionally, the use of the delay command may be necessary between events where appropriate, e.g.
delay 0.5
, with the value of the delay set appropriately.