• 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: Dave <email@hidden>
  • Date: Sat, 12 Dec 2015 13:06:57 +0000

This seems to work ok in case anyone wants it!

All the Best
Dave

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

		--
		-- Execute the Script
		--

		set myAppPath to "\"" & myAppPath & "\""
		set myMediaToolPath to "\"" & myMediaToolPath & "\""
		set myVolumePath to "\"" & myVolumePath & "\""

		set myShellCommand to myMediaToolPath & " --volume " & myVolumePath & " --applicationpath " & myAppPath & " --nointeraction"
		log myShellCommand

		do shell script myShellCommand with administrator privileges

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


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

  • 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