Re: How to Run a "sudo" Terminal Command
Re: How to Run a "sudo" Terminal Command
- Subject: Re: How to Run a "sudo" Terminal Command
- From: Christopher Nebel <email@hidden>
- Date: Sat, 09 Jan 2016 16:20:09 -0800
> On Dec 13, 2015, at 2:05 AM, S. J. Cunningham <email@hidden> wrote:
>
> I was, however, wondering if there were not a way to create a text shell script, mark it executable, and execute it directly without having to resort to an intermediate application like Applescript or BBEdit to avoid the terminal popping up.
There are two ways that I’m aware of offhand:
One is to use Script Menu, which supports executable shell scripts. Turn on Script Menu (Script Editor > Preferences > General > Show Script menu in menu bar), add your script to the appropriate Scripts folder, and run it by picking the menu command for it.
Two is to embed it in an application bundle as the main executable. You then have a double-clickable application that executes your script without involving Terminal. The easiest way to make one is probably to save an applet from Script Editor, then replace the “applet” executable in Contents/MacOS with your script. The name “applet” is specified in the bundle’s Info.plist, so if you want to name the file something different, edit the Info.plist (specifically, the CFBundleMainExecutable value) to match.
—Chris Nebel
Automation Engineering
_______________________________________________
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