I am trying to find a script that when I select all of my Albums in iPhoto 09 it will rename all the photos to the name of the album it is currently in, plus add a space, a dash and another space. For Example
Album Name is “Family” it will change the name of all the photos in that album to: Family -
try this, select one or multiple albums and run the script. The script aborts if only photos are selected.
As many files will be renamed, please test the script with a copy of your library or with a small album.
tell application "iPhoto"
set selectedAlbums to selection
if class of item 1 of selectedAlbums is album then
repeat with oneAlbum in selectedAlbums
set albumName to name of oneAlbum
repeat with aPhoto in (get photos of oneAlbum)
set name of contents of aPhoto to albumName & " - " & (get name of aPhoto)
end repeat
end repeat
end if
end tell
Note: Consider if a photo is in more than one album you might get unexpected behavior by a chain of album names