I'm using a custom saved rename preset for handling a standard filename rename I must do on a daily basis, many times a day.
Sample filenames I face are:
test - dkc - invoice - maint misc - test.pdf
test - vet - invoice - maint misc - test.pdf
transaction_something.pdf
In any of these cases, I need the rename present to produce this:
2024-05-07 - dateitem - dkc - invoice - maint misc - test.pdf
The precise date is already written into the rename preset, as is " - dateitem - ". The idea is that the first part of the existing name is removed and replaced with the date and the " - dateitem - " addendum, then followed by the rest of the existing/current name. BUT, also, the first segment of the existing filename is removed, to get the result I need.
My preset works perfectly for files which have either of these standard formats:
test - dkc - invoice - maint misc - test.pdf
test - vet - invoice - maint misc - test.pdf
...but it does not work if the filename has this format:
transaction_something.pdf
I can of course create a different preset for each of the two scenarios, but I'm hoping to have a single preset which can handle both situations.
I've included screenshots of how my customer preset is currently working, here:
I hope I've explained this well enough... and I really hope someone can help with providing a single rename preset that can correctly rename these files in either format.
No, not quite right. When the filename is "rransaction_something" I was to preserve the entire exiting name but add the " - dateitem - " to th e front of the file name, keeping "transaction_something" in the name but following the inserted new bit.
I can't copy/paste the expression you're suggesting (could you add it as a non-pic?) but based on your question, I don't thikn that will solve the problem anyway.
Looks valuable, thanks, but I'm going to have to spend a lot time figuring out how to make use of it. So my hope is that very clever person reading this thred will be able to give me the "easy" solution that I am stupidly not seeing.
Alternatively, for a toolbar/menu button or hotkey, you could also run the Rename command twice, with different regex, and avoid scripting. The Rename dialog can generate those commands for you (use the Clipboard button/menu at the bottom), and you'd just want to add the NOMATCHNOFAIL argument to the two commands, so they doesn't skip files which fail the first regex.