Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Doctor Q

Administrator
Original poster
Staff member
Sep 19, 2002
40,461
9,359
Los Angeles
I have written a shell script ("fixup") that a teacher uses. (The purpose of the script isn't relevant to my question, but it's to fix a file that ends up wrong when she creates a netboot image with Carbon Copy Cloner.)

She currently runs the script in Terminal using sudo or su and typing the superuser (root) password. i would like to make it double-clickable instead so she doesn't need to type commands in Terminal. I started by making file fixup.command, which has the necessary command to invoke the shell script.

Now what? I know she needs to be prompted for the superuser password. I vaguely remember there is an application you can drag a command file into, and it will prompt for the superuser password and then execute the command. Am I remembering right? What is it's name? Is that all I need? Can I make this work by double-clicking something instead of having to remember to drag and drop?

Thanks!
 
Are you using Applescript? That would be the easiest. You can have applescript prompt for the password. Dont remember the command off hand. and then have:

tell application "terminal"
do shell script "sudo [put your script here]"
do shell script [variable for password]
quit
end tell

Something like that, then save it as an application and you have it double clickable.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.