bluesxman wrote: ↑2023-Jul-11, 12:59 pm
I don't think there is a more elegant native way.
OK, thanks.
bluesxman wrote: ↑2023-Jul-11, 12:59 pmIncidentally, you probably want to protect your file names, vars with quotes -- in case of spaces/special characters.
bluesxman wrote: ↑2023-Jul-11, 12:59 pmAlso there is a hard limit to the length of a variable, so if you have a lot of entries a pseudo-array would probably be a better choice, rather than a single string variable. But I'll leave that as an exercise for the reader.
I'm a big believer in accounting for all possible problems, but in this case neither one should be an issue.
I'm making this to perform a very specific task. It will be part of a script for renaming files from one specific website. When people post images there, sometimes they post related images and I like to add something to the name, as well as a number so that they're grouped together and kept in sequence. I already have a script to do this, but as it's most convenient to have my file manager sort them with the newest listed first, I always have to make sure to save the images in the reverse order of how they should be numbered. Or I have to stop, reverse the sort order, invoke my script, then reverse the sort again.
Being able to take the given list of files and automatically sort them according to date, oldest first, before renaming them will be more convenient.
And since the files are all named in a particular way from the site, they never contain any problematic characters or spaces. I've also tested it with 100 filenames of this type and the variable was able to hold them all. I don't think I've ever saved more than 20-30 in one sequence, so that should be enough.
Plus my script does other tricks, like using a third-party command to bring the existing rename script window to the front, so that I can use the command history to recall previous entries in case I want to alter one I used previously. It also creates an Undo script in case I make a typo and don't notice it before hitting Enter. In which case, I can undo the changes, select the files again, use the command history to recall my previous entry and then fix the typo.
