How can I do this???

Discussion in 'macOS' started by jbrown, Dec 2, 2006.

  1. jbrown macrumors 6502a

    jbrown

    Joined:
    Jul 7, 2002
    Location:
    London
    #1
    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:)
     
  2. knome macrumors 6502

    knome

    Joined:
    Sep 7, 2006
  3. jbrown thread starter macrumors 6502a

    jbrown

    Joined:
    Jul 7, 2002
    Location:
    London
    #3
    Could you explain how...I'm a bit of a lud-ite!!
     
  4. jbrown thread starter macrumors 6502a

    jbrown

    Joined:
    Jul 7, 2002
    Location:
    London
  5. Unorthodox macrumors 65816

    Unorthodox

    Joined:
    Mar 3, 2006
    Location:
    Not at the beach...
    #5
    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.
     
  6. jbrown thread starter macrumors 6502a

    jbrown

    Joined:
    Jul 7, 2002
    Location:
    London
    #6
    Now THAT is a spot on answer.....

    Thank you very much:D :D :D
     
  7. Unorthodox macrumors 65816

    Unorthodox

    Joined:
    Mar 3, 2006
    Location:
    Not at the beach...
    #7
    Hmm...
    I just realized something. It will only work when you drag a group of photos on at the same time.
    If you put them in individually or lump sum style, it wont work.
    I'll try to post a better version.
     
  8. ddekker macrumors regular

    Joined:
    Sep 23, 2006
    Location:
    Michigan
    #8
    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
     

Share This Page