How to loop a macro with different urls as a variable?

Hey all! Loving KM, I am quite new here and have not seen this question been asked anywhere yet.

I have built a macro, that sends a personalized audio message to our clients. The macro is built and working! The only missing part is that it loops with different URL's. So for example in the screenshot you see the URL: https://www.drtraffic.nl/ in second run it should be LINK2 and in the third run it should be LINK3. Any idea how we can do this? :smile:

Create a variable with the list of URLs (one URL per line). Then, outside the repeat loop, set up a For Each action:

The For Each is set to "The lines in," and then the name of the variable you created—in this example, it's local_myURLlist that holds the list of URLs. The For Each action will assign local_theURL to each URL in the list in turn, which will then go through your 5x repeat loop.

In the Open URL action, change it to open this URL: %Variable%local_theURL%

This will use the ever-changing URL from the For Each loop. I think this would accomplish what you're trying to do.

-rob.

Rob, why would you need 5x here? Won't it open each of the 5 urls in the variable if this was set to repeat 1x?

I was just repeating the structure they had in place—I wasn't sure of the purpose. But yes, if you just need to do the action once for each URL in the list, you don't need the nested Repeat.

Re-reading it, your read is probably correct. :slight_smile:

There's probably an even better way to structure this, if we could see the full macro—I don't know that all those actions needs to be repeated for every URL?

-rob.

I was just curious if I misunderstood :+1:

1 Like