From: Jack Jansen Date: Mon, 23 Dec 1996 17:28:53 +0000 (+0000) Subject: Added a chapter on using OSAXen X-Git-Tag: v1.5a1~655 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a742d117db32600445f2f81315c424f53f188550;p=thirdparty%2FPython%2Fcpython.git Added a chapter on using OSAXen --- diff --git a/Mac/Demo/applescript.html b/Mac/Demo/applescript.html index 379ac60ca005..b4638d2bc7b9 100644 --- a/Mac/Demo/applescript.html +++ b/Mac/Demo/applescript.html @@ -161,6 +161,23 @@ AppleScript calls: MacOS.Error is raised for all of the errors that are known to be OSErr-type errors, server generated errors raise aetools.Error.

+

Scripting Additions

+ +If you want to use any of the scripting additions (or OSAXen, in +everyday speech) from a Python program you can use the same method +as for applications, i.e. run gensuitemodule on the +OSAX (commonly found in System Folder:Extensions:Scripting Additions +or something similar), define a class which inherits the generated +class and aetools.TalkTo and instantiate it. The application +signature to use is 'MACS'.

+ +There are two minor points to watch out for when using gensuitemodule +on OSAXen: they appear all to define the class System_Object_Suite, +and a lot of them have the command set in multiple dialects. You have to +watch out for name conflicts, so, and make sure you select a reasonable dialect +(some of the non-english dialects cause gensuitemodule to generate incorrect +Python code).

+ That concludes our simple example. Again, let me emphasize that scripting support in Python is not very complete at the moment, and the details of how to use AppleEvents will definitely change in the