Variable text reference from list

Hi there,

I am struggling with a particular macro that I need to execute.

Basically what I want to emulate is the following; Variables for pasting?

However where my requirements differ is I need the list to refer a different line each time it loops moving down the list as it progresses.

Thanks for your help!

Have you looked at the For Each action using the Collection "LInes in" ? This links provides an example.

Thanks Michael, definitely a lot closer than I was before.

I have gotten to the point where it is only putting the first line from the list, once the macro loops, it pulls the same line over and over. This is what I have at the moment.

Does this depend on how the list is formatted before it can be read correctly? I might be missing something here.

Hey @bitdepth,

It's better to not use the abbreviated format of %SingleLine% for text token variables – use %Variable%SingleLine%. The former works but is not good practice, and Peter may very well make it more strict in future.

It seems to me that Jimmy's macro does exactly what you want except from a variable instead of a named clipboard (and with a minor embellishment).

When asking for help like this it's best to provide a complete working macro if possible. (The Keyboard Maestro share menu makes this easy.)

When people have a downloadable macro available to test they're more likely to help you.

The appended macro works for me. Give it a try and see if you can figure out what's wonky with yours.

-Chris


Paste Each Line from a Named Clipboard.kmmacros (5.8 KB)

That's because you have a Break from loop action. Just remove this Action and it should process all lines.

Remove this:
image