I am using a vbscript saved as toolbar button that updates modified date based on dates within the file names. It is something I often use.
Am -not- an expert, just wonder whether it would be possible to have that as a rename preset.
I believe rename presets are .orp and XML.
Also note that the script includes a line that launches a 3rd party .exe to perform the task.
Works fine as a toolbar button, but as a rename preset..(??)
Often I rename the files first and then perform the date change.
Example (files having wrong modified date, i.e. date of downloads)
1st step
fm: Screenshot_20200516-203632_WiFiAnalyzer.jpg
to: Screenshot WiFiAnalyzer 16052020 203632.jpg
2nd step:
exit renamer, locate/select the file, somewhere in the list, hit the toolbar button.
The toolbar button script doesn't mind whether there is file name+date or only a date
(like: 20210613 141500.jpg) or dates in USA format, with or with dashes.
I could load a list like
20210531_065458.jpg
20210531_065450.jpg
20210531_065326.jpg
20210531_065314.jpg
20210531_065251.jpg
Add leading text, change the dates to ddmmyyyy, perform the button script all within 1 panel.
All in all, it's just handy to have it all in 1 rename panel (IF at all possible of course).
Note, I already tried with pasting the vbscript text in Rename at [Edit] where it says 'No script is defined' + F5 but I am afraid it didn't work.
Im not totally sure i understood what your renamescript should achieve but i think that should be possible. Your rename script has to implement the
function OnGetNewName(getNewNameData)
for being recognized as valid rename script (this is JS signature but should be simmilar for VB). If you want further processing of the file simply implement another function that gets the getNewNameData passed or the item (file) inside it.
Have a look at the docs for renaming scripts https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Scripting/Rename_Scripts1.htm
But be aware, AFAIK already starting the rename dialog for your script will call the OnGetNewName() (because it will display the filenames before and after renaming) and thus editing files can be done twice (at startup and then when acutally renaming).
Thanks. The script takes dates from file names that has dates added in the name (e.g. Screenshot 16052020 203632.jpg) and then changes the modified dates accordingly. I agree, for most users this may not be important, for me it is.
As said, I am not an expert. If what I want can be achieved easily, fine. It is gets too complicated, I'll let it rest.
Thanks for the tip. @nodeselect works : the files remain selected.
Don't know why but the disablenosel didn't work, but the @nodeselect is fine though.
Do 1st rename, close, update dates, do 2nd rename (if necessary), etc. all with the same files.