Work on each item in a list?

I have a list of words. For example:

borrow
inhabitant
radiation
breakdown
load
ideal
dip
broadcast
electron
loud
conception
hand
toast
lawyer
base
pig
conflict
conglomerate

This list is just an example. The actual word list will be different for each use (and the number of words on the list will vary).

I need to create a Macro that will do the following for every word on the list:

  1. Paste the word
  2. Perform a tab key stroke

E.g. So when I active the macro, the macro will first paste "borrow", then press tab, then paste "inhabitant" then press tab and it will keep on doing this until all the words have been processed.

Is this possible with Keyboard Maestro? I am not sure what's the best way to get my list into Keyboard Maestro (Should I just create a variable from the clipboard and then copy the whole list into the clipboard before triggering the macro?).

I searched around and found this but struggled with adapting it to my needs.

Thanks for any help anyone can offer!

Easy. You can use a For Each action with a Lines in Collection that can come from a file, KM Variable, or Clipboard.

In the For Each Loop, you just need two Actions:

  1. Insert Text action using the For Each loop variable (I would name it Local__Line)
  2. Type a Keystroke action using the TAB keystroke.

image

Questions?

2 Likes