[Pythonmac-SIG] PythonMac vs Python Unix for Mac OSX cgi

Johann Hibschman johannh@uclink.berkeley.edu
Thu, 29 Mar 2001 10:06:45 -0800


On Thursday, March 29, 2001, at 08:53 AM, Steven D. Majewski wrote:

 > If you want to interface with AppleScript,
 > use Carbon MacPython.

I just thought I'd share an awful trick that I discovered yesterday.
I'm more used to unix python, so I'm using that, but you can get
unix python to call applescript by writing the script to a text
file, then calling /usr/bin/osascript on that file via os.system.

This is ugly and slow, but it at least connects the two.  The text
file does have to have Mac line endings, and osascript has to be
called with its full path, but it works.

You all probably already know this, but I'm still pleased with
myself.

Cheers,

--Johann