• 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
Re: Scriplting the Photos application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scriplting the Photos application


  • Subject: Re: Scriplting the Photos application
  • From: Shane Stanley <email@hidden>
  • Date: Sun, 19 Apr 2015 09:13:18 +1000

On 19 Apr 2015, at 5:11 am, Bill Cheeseman <email@hidden> wrote:

Has anybody made progress scripting Photos? 

I am stuck on the 'selection' property of the 'application' class. I can get a reference to a selected 'media item' (a photo) by telling the application to 'get first item of (get selection)'. But if I then try to 'get properties of result' -- or any individual property of a media item -- I get a "handler failed" error instead.

This works fine here:

tell application id "com.apple.Photos" -- Photos
set theSelection to selection
repeat with i from 1 to count of theSelection
properties of item i of theSelection
end repeat
end tell


There seem to be timing issues when changing some properties, but otherwise it seems to work.


-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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: Scriplting the Photos application
      • From: Bill Cheeseman <email@hidden>
References: 
 >Scriplting the Photos application (From: Bill Cheeseman <email@hidden>)

  • Prev by Date: Scriplting the Photos application
  • Next by Date: Re: Scripting Terminal ?
  • Previous by thread: Scriplting the Photos application
  • Next by thread: Re: Scriplting the Photos application
  • Index(es):
    • Date
    • Thread