[Pythonmac-SIG] Applevents to running applications..

Sean Hummel seanh@prognet.com
Wed, 15 Jul 1998 13:03:30 -0700


Try out the OSAm Module that comes with Python 1.5.1,
we wrote it here at RealNetworks to glue together our buildsystem.

It allows for Applescripts to be called directly as text from within Python.
 So basically you generate the Applescript as text, and it compiles and runs
the script.

Also it supports running already compiled scripts, and saving scripts in the
compiled format.

It doesn't come with any good docs, because the guy who sent it to Jack,
forgot to ship the example code.

Basically it has the following commands:

OSAm.CompileAndExecute(<Applescript as a string>)
OSAm.CompileAndSave(<Applescript as a string>,<path to new file>)
OSAm.RunCompiled(<path to already compiled file>)


Anyway it is in the "contrib:OSAm" directory, just put the plugin in your
plugins directory.



>At 7:08 PM +0200 7/15/98, Th. Fettig wrote:
>>I am doing a workflow-component using Python as 'steering' and
>>interface to our database, and would need to talk to various
>>Applescripts i wrote (saved as application..) via the default
>>handlers (run,open,save,quit). Has anybody done this yet? I looked
>>around for a while, but only found facilities to use converted
>>Dictionaries.. which is totally dependent on signatures, but these
>>do not differ for Applescripts!!
>>Sending Events is also possible via PSN (process serial numbers), so
>>before i start coding C, i wonder if there's a way to get the PSN in
>>Python and use the AE-module to construct and handle events directed
>>to the running processes. Is this possible? Any examples available?
>
>(I'm not too familiar with Bill Bedfords PythonScript module so I don't
>know if it helps, but do check it out, it's in :Mac:Contrib: PythonScript)
>
>As far as I know there is no interface to the Process Manager yet.
>If you *know* how to do it in C, and you don't need 68k support, consider
>Jack's Most Wonderful calldll module (in the standard distr).
>You can make Python crash just like with C, but you'll still be done
>quicker. See :Mac:Demo:calldll: for some examples, and search the archives
>of this list for "MicroSeconds", for a bad and a good example of what it
>can do with Toolbox calls.
>
>Just
>
>
>
>_______________________________________________
>Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
>http://www.python.org/mailman/listinfo/pythonmac-sig
>



-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
                   Sean Hummel
                 RealNetworks Inc.
           Core Technologies Developer

"Just where are we going? And why are we in this
handbasket?"

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=