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