--
on run
tell application "Aperture"
-- activate
set Oggetto to ""
set imageSel to selection
if imageSel is {} then
error "Please select an image."
else
set theResult to choose from list {"Version Name", "Caption", ¬
"Keywords", "Title"} ¬
with title ¬
"Modifica IPTC Tag" with prompt ¬
"Scegli cosa cambiare:" multiple selections allowed false ¬
without empty selection allowed
--
--
if item 1 of theResult is "Version Name" then
set Oggetto to "VersionName"
end if
if item 1 of theResult is "Caption" then
set Oggetto to "Caption/Abstract"
end if
if item 1 of theResult is "Keywords" then
set Oggetto to "Keywords"
end if
if item 1 of theResult is "Title" then
set Oggetto to "ObjectName"
end if
--
--
display dialog "Scrivi il testo di " & item 1 of theResult & ¬
" :" default answer ""
set testo to the text returned of the result
--
repeat with i from 1 to count of imageSel
if (IPTC tag Oggetto of item i of imageSel) exists then
set value of IPTC tag of item i of imageSel ¬
to testo
else
tell item i of imageSel
make new IPTC tag with properties {name:Oggetto, value:testo}
end tell
end if
-- delay 5
end repeat
-- set fullscreen to false
end if
end tell
end run
It runs smoothly without a hic from within script debugger 4.5.
I put the compiled script (Modify IPTC Tags.scpt) in ~/Library/Scripts/Aperture (tried also ~/Library/Scripts/Applications/Aperture) BUT when I'm under Aperture and try to launch the script clicking on the script folder in the menu bar nothing seems to happen.