sudo password?

Hello all newbie here,
I’ve got a question concerning how to enter a password via applescript into terminal while terminal is running a sudo command.
Here’s what’s should be happening.
User opens Cocoa app, app asks for users password, then user hits “go”. From there app opens terminal and runs “sudo cp ~/ /Volumes/cd-r” password is entered, and files are copied to the cd-r for me to burn at a later date.
So, I get hung up on the sudo password prompt. I can’t figure out how I’d tell applescript to do this.
All help is appreciated.

: So, I get hung up on the sudo password prompt. I can’t figure out how I’d
: tell applescript to do this.
: All help is appreciated.
Try using the “System” scripting additon.
http://osaxen.com/system.html
This aids in scripting the Terminal and the addition, of course, is fully OS X native.
Be well.
T.J. Mahaffey

Thank you!
I also cooked this up for all who have a problem like I did… (if you’re not making a GUI front end, ignore the on clicked theObject, it’s AppleScript Studio)
on clicked theObject
tell application “Terminal”
do script with command "echo ‘be_cool’ | sudo -S /usr/sbin/nvram boot-device=ide1/@0:5,:tbxi
end tell end clicked
Note the use of single quotes around the “password” (be_cool), with double quotes around the password you’d see AppleScript crunch up a little. :wink:

Why script the terminal when you can use the ‘do shell script’ command?
on clicked theObject
do shell script “ls” password “be cool” [b:000]with[/b:000] administrator privileges
end clicked
: Thank you!
: I also cooked this up for all who have a problem like I did… (if you’re not
: making a GUI front end, ignore the on clicked theObject, it’s AppleScript
: Studio)
: on clicked theObject
: tell application “Terminal”
: do script with command "echo ‘be_cool’ | sudo -S /usr/sbin/nvram
: boot-device=ide1/@0:5,:tbxi
: end tell end clicked
: Note the use of single quotes around the “password” (be_cool), with
: double quotes around the password you’d see AppleScript crunch up a
: little. :wink:

Now that’s even better! Thank you
: Why script the terminal when you can use the ‘do shell script’ command?
: on clicked theObject do shell script “ls” password “be
: cool” with administrator privileges end clicked