• 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: How to Run a "sudo" Terminal Command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: How to Run a "sudo" Terminal Command


  • Subject: RE: How to Run a "sudo" Terminal Command
  • From: "Jacopille, David" <email@hidden>
  • Date: Sat, 12 Dec 2015 12:56:43 +0000
  • Thread-topic: How to Run a "sudo" Terminal Command

I would concatenate single quotes around paths when building commands.

 

From: applescript-users-bounces+djacopille=email@hidden on behalf of Dave
Sent: Saturday, December 12, 2015 7:49:10 AM
To: asu
Subject: Re: How to Run a "sudo" Terminal Command


> On 12 Dec 2015, at 12:34, Axel Luttgens <email@hidden> wrote:
>
> with admnistrator privileges

when I try this command:

                do shell script myShellCommand with admnistrator privileges

I get an error in Script Editor on the word “privileges”, I tried it without the word “privileges” but get an error, not sure if its because of this or something else?

Here is whole Script, I just want to automate building Mac OS X Emergency Install Disks.

on run
        tell application "Finder"
                --
                --  Setup Source App
                --
                set myApp to choose application with prompt "Select the Installer Application" as alias
                set myAppPath to POSIX path of myApp
               
                --
                --  Setup Install Media Tool Path
                --
                set myMediaToolPath to myAppPath & "Contents/Resources/createinstallmedia"
               
                --
                --  Setup Destination Volume
                --
                set myVolumeList to list disks
                set myVolume to choose from list myVolumeList with prompt "Select Destination Volume"
                set myVolumePath to "/Volumes/" & myVolume
               
                set myShellCommand to myMediaToolPath & " " & "--volume " & myVolumePath & "--applicationpath " & myAppPath -- & "--nointeraction"
                do shell script myShellCommand with admnistrator
               
        end tell
end run

I think maybe I need to do something special with spaces in the file/folder paths?

Thanks a lot for any help on this.

All the Best
Dave





 _______________________________________________
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

MFS Email system made the following annotation
---------------------------------------------------------------------------------------------------------------------------------------
This email communication and any attachments may contain proprietary, confidential, or privileged information. If you are not the intended recipient, you are hereby notified that you have received this email in error and that any review, disclosure, dissemination, distribution or copying of it or its contents is prohibited. The sender does not waive confidentiality or any privilege by mistransmission. If you have received this email in error, please notify the sender immediately, delete this email, and destroy all copies and any attachments.
 _______________________________________________
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

References: 
 >How to Run a "sudo" Terminal Command (From: Dave <email@hidden>)
 >Re: How to Run a "sudo" Terminal Command (From: Axel Luttgens <email@hidden>)
 >Re: How to Run a "sudo" Terminal Command (From: Dave <email@hidden>)

  • Prev by Date: Re: How to Run a "sudo" Terminal Command
  • Next by Date: Re: How to Run a "sudo" Terminal Command
  • Previous by thread: Re: How to Run a "sudo" Terminal Command
  • Next by thread: Re: How to Run a "sudo" Terminal Command
  • Index(es):
    • Date
    • Thread