display dialog "com.apple.iWork.Pages" giving up after 5
--> {button returned:"", gave up:true}
which means that we didn't pressed a button during the defined time duration.
When the instruction is wrongly treated — in fact not treated at all — here, the dialog is displayed for a long time and the script fails with the error :
error "Erreur dans wxyz : Délai dépassé pour un AppleEvent." number -1712
I made an other test with :
tell application "Pages"
get id
tell me to display dialog result giving up after 5
say "passed"
end tell
Logically, the errors linked to display dialog don't strike.
But, as say is a Standard Additions feature it issue them.
tell application "AppleScript Editor"
display dialog "com.apple.iWork.Pages" giving up after 5
--> {button returned:"", gave up:true}
end tell
tell application "Pages"
say "passed"
--> error number -1708
«event ascrgdut»
--> error number -1708
say "passed"
--> error number -10004
end tell
tell current application
say "passed"
end tell
If I run the script a second time, only the error -10004 is issued.
I forgot to write that when a script is run several times, in Pages, there is no error issued after display dialog
To get rid of them, one more time « tell me to » is the correct weapon.
tell application "Pages"
get id
tell me to display dialog result giving up after 5
tell me to say "passed"
end tell
gave this log report :
tell application "AppleScript Editor"
display dialog "com.apple.iWork.Pages" giving up after 5
--> {button returned:"", gave up:true}
end tell
tell current application
say "passed"
end tell
Mail behave exactly the same way .
At first execution, display dialog issue the two errors -1708 but no error -10004
say issue error -10004
If we run again, only say issue an error.
As I always got this behavior, I was not surprised.
I will mad tests running the system in English for see.
If I don't get the errors, I will file a report.
I guess that it means that one string is localized which was supposed to stay in English.
I didn't saw that since the Apple //gs era.
Yvan KOENIG (VALLAURIS, France) dimanche 16 février 2014 10:51:09