Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a742d117
Commit
a742d117
authored
Dec 23, 1996
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a chapter on using OSAXen
parent
a83caa03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
Mac/Demo/applescript.html
Mac/Demo/applescript.html
+17
-0
No files found.
Mac/Demo/applescript.html
View file @
a742d117
...
...
@@ -161,6 +161,23 @@ AppleScript calls: <CODE>MacOS.Error</CODE> is raised for
all of the errors that are known to be
<CODE>
OSErr
</CODE>
-type errors,
server generated errors raise
<CODE>
aetools.Error
</CODE>
.
<p>
<H2>
Scripting Additions
</H2>
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
<CODE>
gensuitemodule
</CODE>
on the
OSAX (commonly found in
<CODE>
System Folder:Extensions:Scripting Additions
</CODE>
or something similar), define a class which inherits the generated
class and
<CODE>
aetools.TalkTo
</CODE>
and instantiate it. The application
signature to use is
<CODE>
'MACS'
</CODE>
.
<P>
There are two minor points to watch out for when using gensuitemodule
on OSAXen: they appear all to define the class
<CODE>
System_Object_Suite
</CODE>
,
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).
<P>
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment