Script to copy the iPhoto "Comment" to the standard IPTC "Caption" field. This uses GraphicConverter as a helper app. It's based on an Apple sample script, but their version opens and recompresses the image in GraphicConverter - leading to loss of image detail, etc. This version doesn't even open the image, and no change to the photo takes place at all. It's quite a bit faster too.

Save this as a script in /Users/yourname/Library/Scripts/iPhoto Scripts/ and enjoy.

Click here to open this script in Script Editor (Doesn't always work...)

-- Originally found at Apple, but that version actually Opened the file in GC, changed the comment,
-- and resaved. This was slower, but even worse it recompressed the photo down to whatever the
-- current GC default was. Yikes! This version changes the code to just change the IPTC caption
-- without even opening the actual photo. Nifty huh?
-- This change by Mitch Cohen, mcohen -at- msystems -dot- com.
--
-- This uses GC's get/set file iptc command, which as of version 5.6.2 returns an
-- undocumented string list. Through GC's GUI testing I've determined the list as:
-- 1 theCaption
-- 2 theCaptionWriter
-- 3 theHeadline (seems to go to the Title tag per iView)
-- 4 theInstructions
-- 5 theByLine (Author per iView)
-- 6 theByLineTitle (Author Title per iView)
-- 7 theCredit
-- 8 theSource
-- 9 theTitle (seems to go to the Product tag per iView)
-- 10 20050802 (event date)
-- 11 theCity
-- 12 theState
-- 13 theCountry
-- 14 theReference (Transmission per iView)
-- 15 Cat (category, 3 chars max) (Genre per iView)
-- 16 suppCat1,suppCat2,suppCat3 (Categories per iView)
-- 17 1 (priority, unknown spec) (a 1 will cause it to be red in iView - high priority?)
-- 18 keyword1,keyword2,keyword3
-- 19 theCopyrightNotice
-- 20 theURL (not a standard, but common)

--Thorsten Lemke (GC's author) was nice enough to write, and gave me this order:
-- 1 caption
-- 2 captionwriter
-- 3 headline
-- 4 specialinstructions
-- 5 byline
-- 6 bylinetitle
-- 7 credit
-- 8 source
-- 9 objectname
-- 10 datecreated
-- 11 city
-- 12 state
-- 13 country
-- 14 reference
-- 15 category
-- 16 subcategory
-- 17 urgency
-- 18 keywords
-- 19 copyright
-- 20 url

try
tell application "iPhoto"
activate
set the view to organize
-- display dialog "Write the title and/or comments of the selected images to their corresponding IPTC tags? This uses GraphicConverter, and will not recompress the image." buttons {"Cancel", "Comments", "Both"} default button 3
display dialog "Write the comments of the selected images to the Caption IPTC tag? This uses GraphicConverter, and will not recompress the image." buttons {"Cancel", "Comments", "Both"} default button 3
set the user_choice to the button returned of the result
end tell
copy (my selected_images()) to the selected_photos
if the selected_photos is false then error "Please select some images."

repeat with i from 1 to the count of the selected_photos
tell application "iPhoto"
set this_photo to item i of the selected_photos
tell this_photo
set this_title to the title
set this_comment to the comment
set this_imagefile to (image path) as POSIX file as string as alias
end tell
end tell
set this_title to plain_text(this_title)
set this_comment to plain_text(this_comment)
if this_title is not "" or this_comment is not "" then
tell application "GraphicConverter"

--Below is my change
set iptc_list to get file iptc of this_imagefile
if this_comment is not "" then set item 1 of iptc_list to this_comment
--if this_title is not "" then set item 9 of iptc_list to this_title --doesn't go into correct field
set file iptc of this_imagefile to iptc_list

--Below is the original Apple version
--open this_imagefile
--tell window 1
-- if the user_choice is "Both" then set IPTC objectname to this_title
-- set IPTC caption to this_comment
--end tell
--save window 1
--close window 1 saving no
end tell
end if
end repeat
tell application "iPhoto"
activate
display dialog "Process completed." buttons {"•"} default button 1 giving up after 2
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 plain_text(this_string)
set the styled_text to this_string as string
if the styled_text is "" then return ""
set the styled_record to styled_text as record
return «class ktxt» of styled_record
end plain_text

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