iPhoto - Set Multiple Comments

Adapted from the 'Photo Summary' Apple's iPhoto Scripts Collection, here's some AppleScript that will set the comment of all currently selected photos at once; handy if you want to enter some common information about a bunch of photos, for example 'Family Reunion 2004 at Mayor's Income, Tennessee'

Be warned that any existing comment text will be clobbered by this script.

Download

iPhoto Set Multiple Comments

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

set the image_count to the count of these_images

set comment_text to text returned of (display dialog "Enter a comment for the selected images:" buttons {"OK", "Cancel"} default answer return & return & return)

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

tell this_photo

set the comment to comment_text

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

  • Speaking of the 1990's http://www.hwg.org/ 4 years 24 weeks ago
  • "Oh, I see! You're like a webmaster from the 1990s, except you can't even code HTML." http://bit.ly/dsjBEX #fb 4 years 24 weeks ago
  • Please, please: DO NOT put a hyperlink on a filename unless clicking on said link actually downloads that file. #ihatesourceforge #uxfail 4 years 24 weeks ago
  • RT @ebertchicago:Josh reminds me: If we went back to what the Founding Fathers wanted, as Sarah Palin desires, she wouldn't be able to vote. 4 years 24 weeks ago
  • RT @tommysalami: Great "how I got into horror" blog post by @brittnahjade http://is.gd/c4dj8 Awwww :) 4 years 24 weeks ago

Older

Contact

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