Try, try again
Yennie at aol.com
Yennie at aol.com
Sun Jun 15 15:40:00 EDT 2003
If you don't mind the password being briefly sent in the clear (as part of
the name of the process), you can use this:
get shell("echo '"&pwd&"' | sudo"&&cmd)
Which comes out to something that looks like:
echo 'MyPassword' | sudo MyCommand
Unfortunately, open process appears to be still broken on OS X. If it wasn't,
you could use the "-S" option to sudo to write the password to the process.
This is really the way it should be done security-wise.
(something like this)
put "sudo -S"&&myCmd into theProcess
open process theProcess
write MyPassword&cr to process theProcess
read from process theProcess until eof
close process theProcess
You can also, of course, execute AppleScript on Mac which should give you the
same results as AppleScript Studio can achieve.
You could also write the password to a temporary file and pass that to sudo.
HTH.
------------------------------
Brian Yennie
Chief Technology Officer
QLD Learning, LLC
www.QLDLearning.com
PH: (904)-997-0212
EMAIL: Yennie at aol.com
-------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.runrev.com/pipermail/metacard/attachments/20030615/608793fc/attachment.htm
More information about the metacard
mailing list