From: joanmg on
Greetings,

I've written a short document with some working examples of how to
interface python with other applications in OS-X via applescript (had
to spend some time figuring it out, and thought I might as well write
it down). The examples include asking Google Earth for the latitude
and longitude of the point at the center of its screen, or using the
finder to pop-up a dialog window to get input from the user:

http://juanreyero.com/article/python/os-x-python.html

Cheers,

Juan
http://juanreyero.com
From: Kevin Walzer on
On 12/11/09 3:13 AM, joanmg(a)gmail.com wrote:
> Greetings,
>
> I've written a short document with some working examples of how to
> interface python with other applications in OS-X via applescript (had
> to spend some time figuring it out, and thought I might as well write
> it down). The examples include asking Google Earth for the latitude
> and longitude of the point at the center of its screen, or using the
> finder to pop-up a dialog window to get input from the user:
>
> http://juanreyero.com/article/python/os-x-python.html
>
> Cheers,
>
> Juan
> http://juanreyero.com

Thanks for these examples.

There is also a Python package that allows you to interface with an
application's AppleScript dictionary via Python itself, without the
intermediate step of using the osascript command-line tool:

http://appscript.sourceforge.net/

You might find that of interest.

--Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
From: Juanre on
Thanks for the pointers to appscript, and for the comments on the
page. I have changed the examples at http://juanreyero.com/article/python/os-x-python.html
to reflect them.

Cheers,

Juan
--
http://juanreyero.com