• 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: Yvan KOENIG <email@hidden>
  • Date: Mon, 20 Apr 2015 09:42:27 +0200

As it seems that sometimes it works sometimes it doesn't you may try to use this kind of awful code :

tell application id "com.apple.Photos"
set theSelection to {}
repeat with j from 1 to 20 # Why not ?
try
set theSelection to (get selection)
exit repeat
on error errMsg number errNbr
-- Here some instructions may use errNbr
end try
end repeat
if theSelection is {} then error "Grabbing selection failed 20 times" number 123451
repeat with i from 1 to count theSelection
set itemProperties to {}
repeat with j from 1 to 20 # Why not ?
try
set itemProperties to properties of item i of theSelection
exit repeat
on error errMsg number errNbr
--  Here some instructions may use errNbr
end try
end repeat
if itemProperties is {} then
error "Grabbing properties of item " & i & " failed" number 123450
else
log itemProperties
end if
end repeat

end tell



With a bit of luck one of the 20 attempts will not fail.

Yvan KOENIG (VALLAURIS, France) lundi 20 avril 2015 09:41:36




 _______________________________________________
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

References: 
 >Scriplting the Photos application (From: Bill Cheeseman <email@hidden>)
 >Re: Scriplting the Photos application (From: Shane Stanley <email@hidden>)
 >Re: Scriplting the Photos application (From: Bill Cheeseman <email@hidden>)
 >Re: Scriplting the Photos application (From: 2551 <email@hidden>)
 >Re: Scriplting the Photos application (From: Shane Stanley <email@hidden>)
 >Re: Scriplting the Photos application (From: Bill Cheeseman <email@hidden>)
 >Re: Scriplting the Photos application (From: Shane Stanley <email@hidden>)
 >Re: Scriplting the Photos application (From: 2551 <email@hidden>)
 >Re: Scriplting the Photos application (From: 2551 <email@hidden>)
 >Re: Scriplting the Photos application (From: Bill Cheeseman <email@hidden>)
 >Re: Scriplting the Photos application (From: Bill Cheeseman <email@hidden>)
 >Re: Scriplting the Photos application (From: 2551 <email@hidden>)
 >Re: Scriplting the Photos application (From: Bill Cheeseman <email@hidden>)
 >Re: Scriplting the Photos application (From: Shane Stanley <email@hidden>)
 >Re: Scriplting the Photos application (From: Axel Luttgens <email@hidden>)
 >Re: Scriplting the Photos application (From: 2551 <email@hidden>)

  • Prev by Date: Re: Scriplting the Photos application
  • Next by Date: Re: sqlite question
  • Previous by thread: Re: Scriplting the Photos application
  • Next by thread: Re: Scriplting the Photos application
  • Index(es):
    • Date
    • Thread