Hi all, I've searched everywhere and wasn't able to find a renaming script that can delete the first word in a filename. I have a "crop at position" button that someone kindly posted on the forum, but you must specify the number of characters to be cropped. If you want to rename a bunch of files and delete the first word, it can't be done with this button. Does anyone know of any code that can be used to achieve this?
I know I'm stretching, but it would also be great if a script could delete all characters before or after a given character. So for example, if my original filename is "example - movies.txt", I could specify with the script that I wanted to delete all the characters before "movies" so the final result would be "movies.txt", having stripped everything that preceded it. Not sure if anyone has figured it out or if they would find this useful. If anyone has any ideas, please share
Hi xbprm, thanks for the tip I don't know anything about regular expression, but I tried out the code in your screenshot and it worked. The only thing needed would be some way to automate it like you said, like a popup box where you would input the word (everything before or after it would be deleted). If anyone has any ideas, please share
They are all so useful! I accidentally posted a question in the scripting section, so since it relates to the above, I might as well ask it here:
For the "Swap Artists" preset, I changed it so that it would just swap words between a dash (as long as there is only one dash). So for example, if I have a book named "Lewis Carroll - Alice in Wonderland.pdf" it would change it to "Alice in Wonderland - Lewis Carroll.pdf". So I tried the following:
Regexp (.+) - (.+) to \2 - \1
It works, but the problem is that the extension is also swapped, so that it results in:
"Alice in Wonderland.pdf - Lewis Carroll"
Is there anyway for me to change the code so that I can avoid swapping the extension?[/url]