On Jun 12, 2009, at 10:32 AM, Philip Aker wrote: System Events, when called from an non-windowserver process like osascript has to be jacked up to a windowserver level.
You will get a “No user interaction allowed. (-1713)” error if you attempt to display UI in osascript, because it doesn’t have UI, but if the script tells System Events to do so it should always work. i.e., as far as I am aware, System Events won’t return −1713 in response to “display alert” or “display dialog” (etc.) no matter which process sends the Apple event. (It will return an error if the event is sent via EPPC, however.)
This bash script produces an error:
$ osascript -e 'display alert "Hi!”’ 0:19: execution error: No user interaction allowed. (-1713)
This does not:
$ osascript -e 'tell application "System Events" to display alert "Hi!"'
(The alert may not appear in front without also sending System Events an “activate” command, but it shouldn’t return a −1713 error.)
-- Chris Page
The other, other AppleScript Chris
|