blob: f7d8f8b193c9199e65845458f56ca93e7177a7fe [file] [log] [blame]
Fred Drake1bd905e2000-10-14 05:06:24 +00001\section{\module{aetypes} ---
2 AppleEvent objects}
3
4\declaremodule{standard}{aetypes}
5 \platform{Mac}
6%\moduleauthor{Jack Jansen?}{email}
7\modulesynopsis{Python representation of the Apple Event Object Model.}
8\sectionauthor{Vincent Marchetti}{vincem@en.com}
9
10
Jack Jansenbae5c962003-04-11 15:35:28 +000011The \module{aetypes} defines classes used to represent Apple Event data
12descriptors and Apple Event object specifiers.
13
Raymond Hettinger92016dc2003-09-22 15:27:11 +000014Apple Event data is contained in descriptors, and these descriptors
Jack Jansenbae5c962003-04-11 15:35:28 +000015are typed. For many descriptors the Python representation is simply the
16corresponding Python type: \code{typeText} in OSA is a Python string,
17\code{typeFloat} is a float, etc. For OSA types that have no direct
18Python counterpart this module declares classes. Packing and unpacking
19instances of these classes is handled automatically by \module{aepack}.
20
21An object specifier is essentially an address of an object implemented
22in a Apple Event server. An Apple Event specifier is used as the direct
23object for an Apple Event or as the argument of an optional parameter.
24The \module{aetypes} module contains the base classes for OSA classes
25and properties, which are used by the packages generated by
26\module{gensuitemodule} to populate the classes and properties in a
27given suite.
28
29For reasons of backward compatibility, and for cases where you need to
30script an application for which you have not generated the stub package
31this module also contains object specifiers for a number of common OSA
32classes such as \code{Document}, \code{Window}, \code{Character}, etc.
Fred Drake1bd905e2000-10-14 05:06:24 +000033
34
Fred Drake1bd905e2000-10-14 05:06:24 +000035
Jack Jansenbae5c962003-04-11 15:35:28 +000036The \module{AEObjects} module defines the following classes to represent
37Apple Event descriptor data:
38
39\begin{classdesc}{Unknown}{type, data}
40The representation of OSA descriptor data for which the \module{aepack}
41and \module{aetypes} modules have no support, i.e. anything that is not
42represented by the other classes here and that is not equivalent to a
43simple Python value.
Fred Drake1bd905e2000-10-14 05:06:24 +000044\end{classdesc}
45
Jack Jansenbae5c962003-04-11 15:35:28 +000046\begin{classdesc}{Enum}{enum}
47An enumeration value with the given 4-character string value.
48\end{classdesc}
49
50\begin{classdesc}{InsertionLoc}{of, pos}
51Position \code{pos} in object \code{of}.
52\end{classdesc}
53
54\begin{classdesc}{Boolean}{bool}
55A boolean.
56\end{classdesc}
57
58\begin{classdesc}{StyledText}{style, text}
59Text with style information (font, face, etc) included.
60\end{classdesc}
61
62\begin{classdesc}{AEText}{script, style, text}
63Text with script system and style information included.
64\end{classdesc}
65
66\begin{classdesc}{IntlText}{script, language, text}
67Text with script system and language information included.
68\end{classdesc}
69
70\begin{classdesc}{IntlWritingCode}{script, language}
71Script system and language information.
72\end{classdesc}
73
74\begin{classdesc}{QDPoint}{v, h}
75A quickdraw point.
76\end{classdesc}
77
78\begin{classdesc}{QDRectangle}{v0, h0, v1, h1}
79A quickdraw rectangle.
80\end{classdesc}
81
82\begin{classdesc}{RGBColor}{r, g, b}
83A color.
84\end{classdesc}
85
86\begin{classdesc}{Type}{type}
87An OSA type value with the given 4-character name.
88\end{classdesc}
89
90\begin{classdesc}{Keyword}{name}
91An OSA keyword with the given 4-character name.
92\end{classdesc}
93
94\begin{classdesc}{Range}{start, stop}
95A range.
96\end{classdesc}
97
98\begin{classdesc}{Ordinal}{abso}
99Non-numeric absolute positions, such as \code{"firs"}, first, or \code{"midd"},
100middle.
101\end{classdesc}
102
103\begin{classdesc}{Logical}{logc, term}
104The logical expression of applying operator \code{logc} to
105\code{term}.
106\end{classdesc}
107
108\begin{classdesc}{Comparison}{obj1, relo, obj2}
109The comparison \code{relo} of \code{obj1} to \code{obj2}.
110\end{classdesc}
111
112The following classes are used as base classes by the generated stub
113packages to represent AppleScript classes and properties in Python:
114
115\begin{classdesc}{ComponentItem}{which\optional{, fr}}
116Abstract baseclass for an OSA class. The subclass should set the class
117attribute \code{want} to the 4-character OSA class code. Instances of
118subclasses of this class are equivalent to AppleScript Object
119Specifiers. Upon instantiation you should pass a selector in
120\code{which}, and optionally a parent object in \code{fr}.
121\end{classdesc}
122
123\begin{classdesc}{NProperty}{fr}
Raymond Hettinger565ea5a2004-10-02 11:02:59 +0000124Abstract baseclass for an OSA property. The subclass should set the class
Jack Jansenbae5c962003-04-11 15:35:28 +0000125attributes \code{want} and \code{which} to designate which property we
126are talking about. Instances of subclasses of this class are Object
127Specifiers.
128\end{classdesc}
129
130\begin{classdesc}{ObjectSpecifier}{want, form, seld\optional{, fr}}
131Base class of \code{ComponentItem} and \code{NProperty}, a general
132OSA Object Specifier. See the Apple Open Scripting Architecture
133documentation for the parameters. Note that this class is not abstract.
134\end{classdesc}
135