• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Scripting Bridge usage, iPhoto example
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Scripting Bridge usage, iPhoto example
      • From: "Jeffrey J. Early" <email@hidden>
  • Prev by Date: Re: Selecting a folder from the sidebar in a save dialog
  • Next by Date: Re: Selecting a folder from the sidebar in a save dialog
  • Previous by thread: Re: Selecting a folder from the sidebar in a save dialog
  • Next by thread: Re: Scripting Bridge usage, iPhoto example
  • Index(es):
    • Date
    • Thread