iPhoto - Set Multiple Titles

Adapted from the 'Photo Summary' Apple's iPhoto Scripts Collection, here's some AppleScript that will set the title of each selected photo incrementally; so if you have three photos selected and you enter 'My Kickass Photo' as the base title, the photo titles will be set to 'My Kickass Photo (1)', 'My Kickass Photo (2)', and 'My Kickass Photo (3)'.

Download Script

iPhoto Set Serial Titles

try
tell application "iPhoto"
activate
copy (my selected_images()) to these_images
if these_images is false then ?
error "Please select the images whose title you want to set."

set the image_count to the count of these_images

set base_title to text returned of (display dialog "Base title for selected images:" buttons{"Ok", "Cancel"} default answer "")

repeat with i from 1 to the image_count
set this_photo to item i of these_images

tell this_photo

set the title to base_title & " (" & i & ")"

end tell
end repeat
end tell
on error error_message number error_number
tell application "iPhoto"
activate
if the error_number is not -128 then
display dialog error_message buttons {"OK"} default button 1
end if
end tell
end try

on selected_images()
tell application "iPhoto"
try
-- get selection
set these_items to the selection
-- check for single album selected
if the class of item 1 of these_items is album then error
-- return the list of selected photos
return these_items
on error
return false
end try
end tell
end selected_images

Syndicate content

Twitter

  • Suddenly remembering that it was #followfriday and not having recommended anyone in a while, He directed you to @VeryShortStory. 4 years 15 weeks ago
  • I've been coding up a storm this week. #fb 4 years 15 weeks ago
  • WE ARE HAPPY TO SERVE YOU :( http://www.nytimes.com/2010/04/30/nyregion/30buck.html?hp #iconic #design 4 years 15 weeks ago
  • RT @eaton It's probably unecessary to generate a unique key pair for my cat, but better safe than sorry. 4 years 15 weeks ago
  • Interesting discussion on loading #drupal CCK field widgets manually: http://bit.ly/c7ICM5 4 years 15 weeks ago

Older

Contact

Andy Chase
(978) 297-6402
andychase [at] gmail.com
GPG/PGP Public Key