• 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: Fri, 12 Jun 2009 10:32:02 -0700

On 2009-06-12, at 08:36:43, Aaron Wyatt wrote:

Phil-

However, of course, there is no "AppleScript Runner" in 10.4.  Nor have I found that "System Events" works in both OSes.  So my question is, is there a cross-os way to do user interaction osascript calls from bash?

I haven't had a problem using "System Events" in 10.4 and 10.5. The call like the one illustrated above is not sufficient for doing user interaction with System Events though. Perhaps you can elaborate on the specific issues you have encountered.

SVP, Philip,

So the error is:
"execution error: No user interaciton allowed. (-1713)"

It seems to be a security thing (maybe?).

No. It's because System Events, when called from an non-windowserver process like osascript has to be jacked up to a windowserver level. In addition, you may have to reactivate the calling application process because osascript won't be considerate and do it for you. Here's something which I think will work on both systems. The key to success is the intent and ordering of the significant calls. There may be some minor changes of the details to get it to work on 10.4.

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>)

  • Prev by Date: Rép: How to manage image-list
  • Next by Date: Re: How to manage image-list
  • 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