Batch process file names with applescript

Just now I found myself with an angry Nuke install that wouldn’t recognize quicktimes unless they ended with “.mov” I have a few hundred linked files at this point, and thankfully most of them weren’t in nuke yet. What did I do? Well I mentioned finder “scripting menu additions” before, but this time I opened one up and tweaked it just a tiny bit to make it much much faster for the specific job I had to do.

The one I modified was “add to file names”. As it comes it brings up a popup box when called and asks you to type in your new text to add, and then asks you if you want prefix of suffix. That’s not really a lot of work, but it is a separate typing step and a mouse clicking step. That slows things down. I modified one line in the script so that it auto populates the text box with “.mov” and also has the default button set to suffix. That means I can call it and hit return and I’m done!

The code change is stupid simple. I added default answer “.mov” and default button 3 to the existing popup. Done. If I would have had more time I would have made it work recursively, so that I could do my whole directory structure in one blow, but that would have been more time coding than compositing, so I stopped there.

If you want to grab a copy of “add mov to filename”, here it is.

I’ve also used it a bunch since then and decided to create a “silent” version. No dialog box. The only thing it does is to add .mov as an extension. You can download “add mov to filename silent” here.

~ by ross on August 15, 2011.