[Pythonmac-SIG] Appscript/administrator privileges

has hengist.podd at virgin.net
Sat Nov 27 16:49:02 CET 2004

Bob Ippolito wrote:

>>>do shell script theLauncher with administrator privileges
>>Ah, right. The Python equivalent to 'do shell script' is 
>>os.system() so it's not an appscript issue. One for Python's Unix 
>>experts, I think. [1]
>>[1] Though if you had to, you could call the 'do shell script' osax 
>>from MacPython using the osax module 
>The typical unix way would be via Authorization Services, which can 
>be done with the Authorization extension that I wrote, as he 
>mentioned.  His question was specifically if he could use the same 
>facility that AppleScript uses for this via appscript, which you 
>answered in the footnote.

Right you are.

BTW & FWIW, a minor clarification: appscript sole purpose is to 
construct and send Apple events to applications using high-level 
scripting terminology. It has no support for calling osaxen - nor is 
any planned. To call osaxen from MacPython, use the osax package 
(note that this requires the aem package), which supplies wrapper 
functions for some of the more useful handlers along with a lower 
level osax() call that uses raw AE codes. Though personally I don't 
recommend using the osax package when there's a Python alternative as 
osaxen are pretty stinky.



More information about the Pythonmac-SIG mailing list