On Dec 22, 2010, at 2:12 AM, Adam Morris wrote:
> How to translate this applescript into appscript?:
>
> do shell script "sudo rm /usr/bin/file" with administrator privileges
>
> Thanks for your software, has.
I don't have the "with" solved, but it goes something like this:
>> import osax
>>
OK, I got it:
> import osax
>
> sa = osax.OSAX()
>
> print sa.do_shell_script("ls -l", administrator_privileges=True)
If you look in the Applescript dictionary, it appears the function syntax is:
> set theResult to do shell script unicode text ¬
> as type class ¬
> administrator priv
> print sa.do_shell_script("ls -l", administrator_privileges=True)
Thanks Charles, I had forgotten that do shell script is a part of the
Standard Addition osax. Now I know how to run a script that needs the
user's permission without having to use some GUI scripts to get the
admin/password dialog.