• 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: run app with root
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: run app with root


  • Subject: Re: run app with root
  • From: "Manoah F. Adams" <email@hidden>
  • Date: Fri, 04 Apr 2014 02:34:43 -0700

On Apr 4, 2014, at 00:17 , Iurista GmbH wrote:

Hi all

I would like to open a program with root privileges.  So my Script looks like:

set password to "pwpwpwpw"  <--THIS ONE I GET FROM THE KEYCHAIN
do shell script quoted form of ".../content/MacOS/XXX" user name "root" password pw with administrator privileges

It works quite fine, but: the applescript does not continue after this step, but is obiously waiting for something coming back.
I tried to send output to dev/null or > /dev/null 2>&1 &, but nothing has helped. Even by googling I did not found a solution...

Does anybody know, how the script can be stopped or continued, without first quitting the app XXX

Thanks for a hint
Rudolf


Hello,

You will need to wrap the 'do shell script' in an 'ignoring application responses' block.
However that isn't enough, because the 'do shell script' is an internal command;
therefore you need to get some (any) other application to do it for you (that way an actual apple event gets sent out).
Here's an example to test with:
ignoring application responses
tell application "System Events" -- <- any convenient app
do shell script "sleep 10; say 'I am still here!'" -- <- any script content
end tell
end ignoring

I'm in pre-sandbox times so I don't know if you can still do that, but if you can, then that is the easiest answer.

Alternatively, if you have access to the Cocoa API (e.g. via AppleScriptObjC) then you could probably use NSTask instead of 'do shell script', as NSTask is asynchronous by default.

Manoah F. Adams
federaladamsfamily.com/developer


 _______________________________________________
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: run app with root
      • From: Shane Stanley <email@hidden>
References: 
 >run app with root (From: Iurista GmbH <email@hidden>)

  • Prev by Date: run app with root
  • Next by Date: Re: run app with root
  • Previous by thread: run app with root
  • Next by thread: Re: run app with root
  • Index(es):
    • Date
    • Thread