I have a master list of 50 URLs, and I want to open 6 URLs at a time whenever macro is triggered.
When next time same macro is triggered, I want the next 6 URLs to open, and so on.
In the last set i.e. a set of URLs after 42-48, macro may open just 2 URLs 48-50 or go ahead and open total 6 URLs fetching URLs from the beginning of the list (i.e. opening URLs 49, 50, 1, 2, 3, 4). I am fine either way.
How to achieve that?
Sharing a set of actions that I currently use in a different macro. This is near to what I'm trying to achieve. Sharing this in case this is helpful in any way to achieve what I asking in this question.
The two actions in red let you specify the number of URLs to be opened each time (the "chunk size") and the name of the file containing the list of URLs themselves. You can freely change these to suit your needs.
Each time the macro is run it takes the first chunk size number of lines from the list and opens them in your default browser (the magenta-coloured action). At the same time it rewrites the file containing the list so that those URLs just opened now appear at the end of the file. That means the list behaves in a circular manner.
I am going to use the one shared by @tiffle because it gives an additional opportunity to use a file which I can append URLs to using siri shortcuts from iPhone too, which can be handy in my use case.
The only difference is that with @tiffle's version, the file will be shuffled every time the macro runs, by sending the URLs just opened to the end of the list.
This means that those URLs will be opened again before any newly added ones. Whether that's of benefit or detriment to your workflow depends on how you'd like it to work.