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

jbrown

macrumors 6502a
Original poster
Jul 7, 2002
997
4
London
I take a lot of fotos of various locations as part of my job.

When I download picyures from my camera, it saves them with the camera code name for the pics - ie, DSC10023 etc.

What I want to do is be able to give a folder a name, and when I drop the files into the folder, it names the pictures with the name of the folder.

So I create a folder called " Shakespeare House " , download 20 or so picture files from my camera into the folder, and it will automatically rename the picture files as " Shakespeare House 1 " , " Shakespeare House 2 ", " Shakespeare House 3 " - and so on.

Any tips?

cheers all:)
 
Since Automator is for weenies, I'll use Applescript.

Open Script Editor. (Applications>AppleScript)
copy past this code into the window:
Code:
on adding folder items to this_folder after receiving added_items
	tell application "Finder"
		set the folder_name to the name of this_folder
		
		repeat with i from 1 to number of items in added_items
			set this_item to item i of the added_items
			set the_extension to the name extension of this_item
			set the_name to (the name of this_folder & " " & i & "." & the_extension) as string
			set the name of this_item to the_name
		end repeat
	end tell
end adding folder items to
Select "Save as…" from the file menu.
Give it a name; save it in, "Macintosh HD>Library>Scripts>Folder Actions".

Now, right click/control click on the folder you want to attach this script to.
Select "Enable Folder Actions". (This may already be enabled)
Right click/control click on the folder again and select "Attach a Folder Action"
Navigate to where you saved the script and select it. Click "Choose".
You're done!


This scrip will rename any files dropped into it to the name of the folder plus a sequential number.
 
I think you select them all and hit F2..lol.. oh no, thats in Windows.. sorry I had to... automator is about the only way I can think of and even then you have to do it outside of iPhoto, anything you do once they are into iPhoto is pretty much not going to happen... iPhoto is its own beast.. thinking of files with names and iPhoto don't go together at all, it uses an XML file to track the info for each photo and renaming a "file" is a no no..

good luck

DD
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.