if they all have the same prefix (bla*.jpg) you can just count the current number of matching files with $findfile(dir,bla*.jpg,0) and inc that by 1. obviously this is flawed, if you delete a file then add another, it'll mess up

this is analogous to what i've seen people doing with INI files, variables etc. to maintain a collection of items they append numbers to enforce order (and try keep it sequential, from 1 to n). but instead, their order alone could just as easily serve as an index. this doesn't help you that much with $findfile (the files are returned to you in alphabetical order, not order of creation) but you can maintain a list in a text file of the filenames without worrying about any of this renaming and keeping the suffixes in sequence. just something to think about!


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde