Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

whocares

macrumors 65816
Original poster
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
 
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 said:
Try File Buddy, it does batch renames and more (no, I'm not affiliated, just a long time user 😛) 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.
 
Applications -> AppleScript -> Example Scripts -> Finder Scripts should have some AppleScripts you're looking for.
 
Thanks all. I've downloaded the apps and will take a look at them and the AS tomorrow.

Cheers,
D
 
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 said:
tjwett -- you have to use the the 'php' feature... your applescrip was messed up by the smily face.

eep 😱 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. 🙄 bahh, just ferget it. im gunna go git destraktid bye sum shynee objeks.
 
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!! 😉
 
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?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.