• 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: Mac OS X 10.4: using osascript to interact with users
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mac OS X 10.4: using osascript to interact with users


  • Subject: Re: Mac OS X 10.4: using osascript to interact with users
  • From: Philip Aker <email@hidden>
  • Date: Wed, 24 Jun 2009 22:50:48 -0700

On 2009-06-24, at 21:32:18, Chris Page wrote:

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.

Technical point realized. I actually have jacked up osascript to have an application menu in the menu bar from one of my components and confounded that with System Events being run from osascript. It just happened that when constructing the script, the dialog was hidden behind several layers of windows and I wanted to make sure he saw the dialog and knew that it wasn't a security issue.


(It will return an error if the event is sent via EPPC, however.)

I'm only vaguely aware of EPPC and restrictions it might have compared to "normal" scripting. Is it that as a rule that no user interaction commands be used, or could one, for example, ask the Finder on the target machine to display the dialog instead of System Events.


set ppname to missing value
set rslt to missing value
tell application "System Events"
set frapps to get name of every application process whose frontmost is true
set my ppname to item 1 of frapps
activate
display dialog "Boston - nuttin' like drivin' 'roun' in coicles."
set my rslt to POSIX path of every file of desktop folder whose visible is true
end tell
tell application ppname to activate
rslt



Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

 _______________________________________________
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: Mac OS X 10.4: using osascript to interact with users
      • From: Chris Page <email@hidden>
References: 
 >Mac OS X 10.4: using osascript to interact with users (From: Aaron Wyatt <email@hidden>)
 >Re: Mac OS X 10.4: using osascript to interact with users (From: Philip Aker <email@hidden>)
 >Re: Mac OS X 10.4: using osascript to interact with users (From: Aaron Wyatt <email@hidden>)
 >Re: Mac OS X 10.4: using osascript to interact with users (From: Philip Aker <email@hidden>)
 >Re: Mac OS X 10.4: using osascript to interact with users (From: Chris Page <email@hidden>)

  • Prev by Date: Re: list issues
  • Next by Date: Re: list issues
  • Previous by thread: Re: Mac OS X 10.4: using osascript to interact with users
  • Next by thread: Re: Mac OS X 10.4: using osascript to interact with users
  • Index(es):
    • Date
    • Thread