Regular Expression Renaming Script Files....
Posted: 29 Jan 2008 18:26
Backstory
Well, a while back I had this idea to write a small script that would run alongside XY and could be called from the Regular Expression renaming dialog to insert some complex patterns. My intent was to write something that might be useful for beginners, so they could use the power of regular expressions without pulling out all of their hair trying to write the patterns.
I almost finished it, but wanted to add some methods for prompting the user to input the values for some variables, and then lost interest. Needless to say it never got done.
Then Don introduced scripting, and with script files there was a solution very close to what I had coded. Now that he's added a way to get user input, it's way better than what I had accomplished.
The point...
I've converted the regular expression patterns I had previously written into XY script file format and have decided to share that with all of you.
These patterns cover the major functionality in a renaming program I use to use before XY, and while there are other ways to achieve plenty of this in XY already, I thought the patterns might be helpful to those trying to learn. (Writing them taught me more than I had expected.)
What follows are the contents of 4 files which I've placed in a directory within my XYplorer directory (".\Scripts"). You can place them elsewhere but you'd need to change the loadScriptFile commands to the new paths.
The first script just calls the other ones and makes the menu function like it has submenus. The other three contain a number of patterns for renaming just the filename, just the extension, or both.
To execute, ensure scripting is turned on, and then run the script "::loadScriptFile Scripts\RegExp-Rename.xys"
Hopefully, this works out okay with copying and pasting from the forums.
NOTE: As scripting is still a work in progress and the syntax and format may change these files may become obsolete. I will try to stay on top of that but I make no promises.
Also, xys, is not an official XY script file extension (at least not at the time of posting). It's just something I'm using to keep things sorted locally.
UPDATE: These scripts have been moved to http://www.xyplorer.com/xyfc/viewtopic. ... 0825#20825
Well, a while back I had this idea to write a small script that would run alongside XY and could be called from the Regular Expression renaming dialog to insert some complex patterns. My intent was to write something that might be useful for beginners, so they could use the power of regular expressions without pulling out all of their hair trying to write the patterns.
I almost finished it, but wanted to add some methods for prompting the user to input the values for some variables, and then lost interest. Needless to say it never got done.
Then Don introduced scripting, and with script files there was a solution very close to what I had coded. Now that he's added a way to get user input, it's way better than what I had accomplished.
The point...
I've converted the regular expression patterns I had previously written into XY script file format and have decided to share that with all of you.
These patterns cover the major functionality in a renaming program I use to use before XY, and while there are other ways to achieve plenty of this in XY already, I thought the patterns might be helpful to those trying to learn. (Writing them taught me more than I had expected.)
What follows are the contents of 4 files which I've placed in a directory within my XYplorer directory (".\Scripts"). You can place them elsewhere but you'd need to change the loadScriptFile commands to the new paths.
The first script just calls the other ones and makes the menu function like it has submenus. The other three contain a number of patterns for renaming just the filename, just the extension, or both.
To execute, ensure scripting is turned on, and then run the script "::loadScriptFile Scripts\RegExp-Rename.xys"
Hopefully, this works out okay with copying and pasting from the forums.
NOTE: As scripting is still a work in progress and the syntax and format may change these files may become obsolete. I will try to stay on top of that but I make no promises.
Also, xys, is not an official XY script file extension (at least not at the time of posting). It's just something I'm using to keep things sorted locally.
UPDATE: These scripts have been moved to http://www.xyplorer.com/xyfc/viewtopic. ... 0825#20825