You are here

2 posts / 0 new
Last post
Help needed with "parents" property #1
Francis Mariani's picture
by Francis Mariani
August 15, 2013 - 10:41am

Page 13 of the Aperture 3 AppleScript Reference manual mentions the “parents” property as a 'Tab-separated list of parent keywords'. Unfortunately, the example only shows how to use one “parents”.

I would like to add Camera Model and Lens Model EXIF info as Aperture keywords. the script below works. I'm hoping to set up this hierarchy: “Cameras and Lenses” > Camera Model > Lend Model (I'd like to have “Cameras and Lenses” as a global parent for Camera Models.

Sticking a tab “\t” between two strings is taken as one string with a tab in the middle.

My script:


tell application "Aperture"
set imgSel to (get selection)
if imgSel is {} then
error "Please select an image."
else
repeat with i from 1 to count of imgSel
tell library 1
tell item i of imgSel
try
if value of EXIF tag "Model" contains "E-M5" then
set cameraModel to "OLYMPUS OM-D E-M5"
else if value of EXIF tag "Model" contains "CX3" then
set cameraModel to "RICOH CX3"
else
set cameraModel to value of EXIF tag "Model"
end if
on error
set cameraModel to ""
end try

try
set lensModel to value of EXIF tag "LensModel"
on error
set lensModel to ""
end try

make new keyword with properties {name:cameraModel}
make new keyword with properties {name:lensModel, parents:{cameraModel}}
end tell
end tell
end repeat
end if
end tell

Any ideas?

Thanks very much,

Francis.

Still using Apple Aperture

Francis Mariani's picture
by Francis Mariani
August 16, 2013 - 2:17pm

This works:

tell application "Aperture"
set imgSel to (get selection)
if imgSel is {} then
error "Please select an image."
else
repeat with i from 1 to count of imgSel
tell library 1
tell item i of imgSel
try
if value of EXIF tag "Model" contains "E-M5" then
set cameraModel to "OLYMPUS OM-D E-M5"
else if value of EXIF tag "Model" contains "CX3" then
set cameraModel to "RICOH CX3 "
else
set cameraModel to value of EXIF tag "Model"
end if
set cameraModel to cameraModel & " _cameras and lenses"
on error
set cameraModel to ""
end try

try
set lensModel to value of EXIF tag “LensModel”
on error
set lensModel to “”
end try

– make new keyword with properties {name:cameraModel}
make new keyword with properties {name:lensModel, parents:{cameraModel}}
end tell
end tell
end repeat
end if
end tell

Still using Apple Aperture

You may login with either your assigned username or your e-mail address.
Passwords are case-sensitive - Forgot your password?