Batch Duplicate File > Then rename?

erickp

Registered
I have a situation where I need to take a file and then duplicate the file several times renaming each new file by adding a length to the end of each one. Below is an example of what I am trying to accomplish. Is this something that would be appropriate for "Automator"? If so, how can I accomplish this task? Thank you for any help!*

Example:

Original file name: *BOC-CABLE.jpg

Need to create these variants:

*BOC-CABLE03.jpg
*BOC-CABLE06.jpg
*BOC-CABLE15.jpg
*BOC-CABLE25.jpg
*BOC-CABLE50.jpg
*BOC-CABLE75.jpg
*BOC-CABLE100.jpg

PS-> I''ve got the renaming thing down with an application called "A Better Finder Rename" but the tricky part is a duplicating the file and then renaming it to add the new part name.


Thank you!
Erick
 
Hi,

You could either use Automator, write a shell script or use something like Perl or Python to do what you want - if you want a drag-and-drop solution then Automator is probably your best bet.

I found the following tutorials very helpful:

http://www.makeuseof.com/tag/using-automator-to-batch-rename-images-mac/
http://www.chriswrites.com/2012/02/how-to-batch-rename-files-in-mac-os-x/

To do what you need, you'd just need to duplicate the "Rename Finder Items" actions for all your filename variants. I don't know whether you can trigger the same action more than once with different variables though - this would be trivial in a programming language because you could just put the different suffixes in their own array, but Automator might not work in this way.

The only thing that didn't quite work with the example Automator scripts I looked at was to put the duplicated files back in the same directory as the originals - they got saved to the Desktop instead. If I was a l33t aut0m4t3r h4xx0r I might know how to fix that but I don't, so you might want to research this yourself and report back :D

Dodg
 
Last edited:
Back
Top