As I said: the numbers are not actually part of the strings. They are just there to show the structure of the tracks. Maybe I should have put the strings between brackets, or in quotes.
As far as I know it is not possible in action directly, because there is no counter function in there.
But you can do it in a roundabout way in my opinion.
You can use a special placeholder %_counter% in export scripts. You can create a text file with the required new titles, then you can use that file to change the %title% fields (Textfile - Tag button).
There is a little code for an export script, but I think it is not very good:
Must be a much better solution. I think the $left part can be replaced with $regexp in some way. But it works if the first part of your title (called StringX) doesn't contain any spaces, and the separator between StringX and SubstrX IS a space.
In the two loop part I used the $strstr function, so if the separator is not a space, you can change the parameter ' ' to the desired separator string. (In that case you have to change the $regexp parameter, too).
It works in these examples:
Titles in files:
ABBA Dog
ABBA Cats and Mice
Beatles Elephant
Beatles Sharks and Whales
The result:
ABBA 1. Dog
ABBA 2. Cats and Mice
Beatles 1. Elephant
Beatles 2. Sharks and Whales
Anyway, I wonder the regexp version of this script.
Forget it! I think indeed the best bet is to write an external file, edit it and read it back.
Awk could do the job well, I guess. In fact I would need a function that can find the largest initial substring of two strings. No idea if any language has this. Would be nice if the mp3tag script could call awk.
Probably a job for a long winter night.
Still my other question: anywhere a decent tutorial for the mp3tag scripting language? Or a couple of representative examples? Is it (like) any existing language? (Although most of these scripting languages are kind of similar).
B.t.w. I think mp3tag is terrific! Unique in its kind. No other tag editor has regexp's! (At least I haven't been able to find one and I looked for a long time before I stumbled onto mp3tag.) I am using it a lot.