I don't think there's any repetition necessary. The easiest way to get a particular line from a text file is a shell script that runs sed. For example
sed -n 10p file.txt
will print the 10th line of the file file.txt. (sed's default behavior is to process and print each line in the file. The -n option tells it not to print by default, and the 10p tells it to print the tenth line.)
So your macro just needs to prompt the user for the line number and then use that variable in a shell script that calls sed. Like this:
OK, so I know the original question has changed somewhat -- but here's a couple of ways of "If I have a text file and the user picks a number n, how do I do something with each of the first n lines". There's a couple of ways to do this -- in both examples change the first action's path to a text file to a file on your machine.
Traditional way is to iterate through an array. KM can treat text as an array by using delimiters -- unfortunately your can't use Return/Linefeed as a delimiter so you have to search'n'replace with your own custom delims:
But KM has "Collections" which you can run through with a "For Each" action. That looks like it will always do all of the items in the collection, but you can maintain a counter and exit the "For Each" loop when you've processed the correct number of items:
Exactly what steps would you do in this task if you were doing it completely manually? You have only mentioned one step - typing a list of items one after another.
Would you type "Pro-Q 3" and then hit return, followed by "Pro-MB" and return? Or is there more to it than that?
It is easy enough to make a Macro that types your list of items one after the other (see below). Maybe you could use this as a start and add in any other steps to the loop, along with the typing. The loop could even execute another Macro on each loop, or invoke a menu item.
Assuming you want to go through the complete list there is no need to specify "49 times" if there are 49 items in the list - but if you did want to limit the loop to a certain number that could be done too.
Without more details of exactly what steps you need to do it is hard to advise.
Anyway, this is how you can type a list of items one after the other and use that loop as the basis of doing more things.
It doesn't matter to KM -- you can (nearly!) always transform text to something usable with a "Search and Replace" action. A good rule is to keep the text in the format most useful to you when you look at it next week/month/year.
In this case I would keep it as one plug-in per line -- it will make it much easier for you to maintain when your plug-ins change and removes the chance that there's confusion when someone calls their plug-in "Flange, Crazy Frog Version" (there's very little chance they'll use a linefeed character in a name).
When making a macro, you need a plan. When asking on the Forum, it's helpful to show your plan in a way that people unfamiliar with what you are doing can understand. It also helps you answer questions before they are asked -- for example:
Why 49 times? Is that the number of pig-ins? If so, wouldn't it be better if it repeated "number of plug-ins" times so it didn't matter if you added/removed some? Or is 49 a hard limit on what you can add, so even a list of 100 items should stop at 49?
The plan can be as simple as:
For each item in my list
a. Open a dialog
b. Type in the item
c. Close the dialog
...and you'll see that @Zabobon's macro above does all that except the "Open a dialog..." step.
Yes. You would include those steps in the loop. And be a good idea to at least initially add some pauses so, the Macro doesn't trip over itself. You could remove or reduce the pauses between actions later if they are not needed. This kind of thing:
Yes the purpose of the repeat 49 times is to have my whole list of 49 plugins added to my favorites.
If the list was longer then I would want the macro to repeat longer.
I see now the best way would have been to repeat until complete.