Keyboard Maestro – Looping Through Each Line of the Clipboard

This graphic illustrates how you can loop through each line of the clipboard and use the line’s value for some purpose. It also demonstrates how to handle the first line differently than the others.

This is zero-based. The second time through the loop will say “Line number 1” if you use the exact setup below. If you need your  i  variable to be “1” on the first loop, just move the  i + 1 calculation above the If All Conditions Met Execute Actions and change the  i is 0  to i is 1. Alternatively you could start i as 1 and change the i is 0  to i is 1.

Screenshot_2015-09-06_07-17-17

Tagged with: ,
Posted in Tech Tips

Leave a Reply

Your email address will not be published. Required fields are marked *

*