PDA

View Full Version : Batch renaming files in OSX




whocares
Mar 3, 2004, 04:21 PM
I've got a whole bunch of photos in various subfolders. Some of these photos have the same relative name (ie same file name but in different folders).

I would like to rename all these files like 000001.ext, 000002.ext etc, independently of file location so I can copy all the files back to one single folder (I can handle that bit in Terminal). There are many sub-folders so I need something recursive.

I've tried Renamer4Mac, but it isn't recursive. Does anyone know of a different app that would work, or even a terminal command/script/binary that would do the trick?

Cheers,
D



johnnyjibbs
Mar 3, 2004, 04:50 PM
It sounds like an Applescript would do the trick nicely, but unfortunately I'm not familiar with it. Hopefully someone will be able to post a nice little Applescript for this function.

Rincewind42
Mar 3, 2004, 04:56 PM
Try File Buddy, it does batch renames and more (no, I'm not affiliated, just a long time user :p) You can grab the latest copy here: http://www.skytag.com/

whocares
Mar 3, 2004, 04:59 PM
Try File Buddy, it does batch renames and more (no, I'm not affiliated, just a long time user :p) You can grab the latest copy here: http://www.skytag.com/

I was looking for something free, the $37 price tag is a bit steep! ;) but thanx anyways.

nicely
Mar 3, 2004, 05:52 PM
I was looking for something free, the $37 price tag is a bit steep! ;) but thanx anyways.

Check out R Name. It's free and works really well.

http://www.versiontracker.com/dyn/moreinfo/macosx/14404

mvc
Mar 3, 2004, 05:56 PM
Or try File Sequencer, its available at www.versiontracker.com

dukemeiser
Mar 3, 2004, 07:09 PM
Applications -> AppleScript -> Example Scripts -> Finder Scripts should have some AppleScripts you're looking for.

whocares
Mar 3, 2004, 08:59 PM
Thanks all. I've downloaded the apps and will take a look at them and the AS tomorrow.

Cheers,
D

live4ever
Mar 3, 2004, 09:09 PM
I like A Better Finder Rename, check it out as well (on Versiontracker).

Nuc
Mar 3, 2004, 09:59 PM
I like A Better Finder Rename, check it out as well (on Versiontracker).

I second this..great app.

tjwett
Mar 4, 2004, 02:00 PM
here's another just incase:

http://www.versiontracker.com/dyn/moreinfo/macosx/21458

check out http://www.macscripter.net for all your AppleScript needs.

and here is a very basic script that may do what you want, or you can modify it if you like:

set items_per_subfolder to 100
set subfolder_prefix to "subfolder "

tell application "Finder"
activate
set the_folder to (choose folder) as alias
set {i, j, the_contents} to {1, 1, (items of the_folder)}
set new_folder to make new folder at the_folder with properties {name:(subfolder_prefix & (j as string))}
repeat with this_item in the_contents
if i > items_per_subfolder then
set {i, j} to {1, (j + 1)}
set new_folder to make new folder at the_folder with properties {name:(subfolder_prefix & (j as string))}
end if
move this_item to new_folder
set i to i + 1
end repeat
beep
display dialog (((count of the_contents) as string) & " items split into " & (j as string) & " subfolders.") buttons {"OK"} default button 1 with icon 1 giving up after 10
end tell

MrMacMan
Mar 4, 2004, 09:53 PM
tjwett -- you have to use the the 'php' feature... your applescrip was messed up by the smily face.

tjwett
Mar 5, 2004, 12:29 AM
tjwett -- you have to use the the 'php' feature... your applescrip was messed up by the smily face.

eep :eek: thanks for the heads up. yeah, ummm....i don't think the smilies will add much functionality to the script. sooorry.

EDIT* and now i can't even figure out how to fix it. humbling indeed. :rolleyes: bahh, just ferget it. im gunna go git destraktid bye sum shynee objeks.

NE1956
Jun 7, 2008, 06:10 PM
Applications -> AppleScript -> Example Scripts -> Finder Scripts should have some AppleScripts you're looking for.


Absolutely PERFECT solution. This is the FIRST AppleScript I've run on my new Mac. No 3rd party apps necessary.

Excellent!! ;)

chouchou54
Jan 17, 2009, 03:53 PM
Try this java-based rename utility : jRename (http://jrename.free.fr)

Works great on OS X

Enjoy !

tweeg
Jan 18, 2009, 04:17 AM
Here is a applescript that should do the trick:

http://mac.softpedia.com/progDownload/Rename-Files-Download-45186.html

miles01110
Jan 18, 2009, 10:20 AM
I like Name Mangler.

NorCal-Cyclist
Jan 18, 2009, 01:05 PM
I like Name Mangler.

+1 for Name Mangler...great for a free app

johny5
Jan 18, 2009, 01:21 PM
Absolutely PERFECT solution. This is the FIRST AppleScript I've run on my new Mac. No 3rd party apps necessary.

Excellent!! ;)

Agreed, I have been trying to create advanced rules for ages using automator but just had a quick browse through some sample scripts and realise scripts are pretty powerful!

I dont want to hijack the thread, but is there a book or somewhere to learn about scripts?