Scripting Bridge usage, iPhoto example
Scripting Bridge usage, iPhoto example
- Subject: Scripting Bridge usage, iPhoto example
- From: "Jeffrey J. Early" <email@hidden>
- Date: Tue, 11 May 2010 18:03:00 -0400
I'm having some difficulties mapping commands from from an AppleScript script to ScriptingBridge and was hoping someone might be able to point me in the right direction.
As a reduced example/test case, I have the following script to set the rating and assign a keyword to the selected photo in iPhoto,
tell application "iPhoto"
set selectedPhotos to the selection
repeat with thisPhoto in selectedPhotos
set rating of thisPhoto to 2
assign keyword string "Vacation"
end repeat
end tell
As long as "Vacation" is an existing keyword, this script works just fine. Trying (what I think should be) the equivalent ScriptingBridge,
iPhotoApplication *iPhoto = [SBApplication applicationWithBundleIdentifier:@"com.apple.iPhoto"];
for (iPhotoPhoto *photo in [iPhoto selection]) {
[photo setRating: 3];
[photo assignKeywordString: @"Vacation"];
}
I find that assigning the keyword silently fails. Setting the rating seems to work fine.
Any ideas what I'm doing wrong? Or this really just broken?
Thanks,
Jeffrey
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden