I'm new to coding and to Applescript but I managed to cobble together a script for Aperture to copy all the Custom Metadata fields for selected images into Keywords for those images. It works but it runs kind of slowly, and I'm guessing it's because I messed up the repeat function somehow and it's performing the same action multiple times. Could someone with better coding knowledge than I take a look and let me know if there's a fix for this?
Code:
on run
tell application "Aperture"
set theSel to the selection
repeat with i from 1 to number of items in theSel
set tImg to item i of theSel
repeat with tImg in theSel
set theOut to ""
repeat with curTag in custom tags of tImg
set tagVal to value of curTag
set theOut to theOut & tagVal & "," & return
set tKey to theOut
try
tell tImg
make IPTC tag with properties {name:"Keywords", value:tKey}
end tell
end try
end repeat
end repeat
end repeat
end tell
end run