> no, I didn't loose anything, I was just testing ;)
that's a relief!
> I don't really understand how you treat my entered file name though.
If I coded it right, here's what it's supposed to do:
SPLIT {entered_filename} into: {filename} and {file_extension} (PNG, JPG, ETC)
IF {filename} ends with the pattern '_map_##'
Remove '_map_##' from end of {filename}
FOREACH map
SAVE map as {filename}_map_##.{file_extension}
> Why don't just take the name exactly as the user entered it and append your suffix (e.g. _map_XX.EXT)
The idea is to allow you to save over an existing image sequence.
So if you've previously saved MyImage_map_01.png, MyImage_map_02.png, ...
You can select any image from that sequence in the file selector and the code will save over the existing sequence of images.
Otherwise, if you selected 'MyImage_map_02.png' from the file selector the code would end up creating a brand new sequence named: 'MyImage_map_02_map_01.png', 'MyImage_map_02_map_02.png', etc. etc.
So that's the idea. It should generally do as you suggest, just take the filename you give it and add '_map_##' to it. But the code does try to be smart and identify the case where you are trying to save over an existing sequence.
The problem with the way I did it before, is that instead of looking for the pattern '_map_##', the code was just stripping ANY AND ALL numbers off the end of the filename. So when you gave it the user named file 'BeepBoop2.png' it wrongly assumed that this was part of a previously saved sequence. My hope is that by using and specifically looking for a more unique pattern ('_map_##') the code can still be smart about guessing when you are trying to replace an existing sequence but have far less chance of getting confused by filenames that happen to contain numbers at the end of them.