@@ -8,32 +8,128 @@ \section{\module{aetypes} ---
88\sectionauthor {Vincent Marchetti}{
[email protected] }
99
1010
11- The \module {aetypes} defines classes used to represent Apple Event
12- object specifiers. An object specifier is essentially an address of an
13- object implemented in a Apple Event server. An Apple Event specifier
14- is used as the direct object for an Apple Event or as the argument of
15- an optional parameter. In AppleScript an object specifier is
16- represented by a phrase such as:
17- \code {character 23 of document "Semprini" }. The classes defined in
18- this module allow this specifier to be represented by a Python object
19- which is initialized as follows:
20- \code {res = Document(1).Character(23)}
21-
22-
23- The \module {AEObjects} module defines the following class:
24-
25- \begin {classdesc }{ObjectSpecifier}{want, form, seld, from}
26- This is the base class for representing object specifiers and is
27- generally not constructed directly by the user. Its important
28- functionality is to define an \function {__aepack__()} function,
29- which returns the Apple Event descriptor containing the object
30- specifier. Its data members, set directly from the constructor
31- arguments, are:
32- \end {classdesc }
33-
34- \begin {memberdesc }{want}
35- A four character string representing the class code of the
36- object. These class codes are specified in Apple Event Suites; for
37- example the standard code for a character object is the 4 bytes
38- \samp {char}.
39- \end {memberdesc }
11+ The \module {aetypes} defines classes used to represent Apple Event data
12+ descriptors and Apple Event object specifiers.
13+
14+ Apple Event data is is contained in descriptors, and these descriptors
15+ are typed. For many descriptors the Python representation is simply the
16+ corresponding Python type: \code {typeText} in OSA is a Python string,
17+ \code {typeFloat} is a float, etc. For OSA types that have no direct
18+ Python counterpart this module declares classes. Packing and unpacking
19+ instances of these classes is handled automatically by \module {aepack}.
20+
21+ An object specifier is essentially an address of an object implemented
22+ in a Apple Event server. An Apple Event specifier is used as the direct
23+ object for an Apple Event or as the argument of an optional parameter.
24+ The \module {aetypes} module contains the base classes for OSA classes
25+ and properties, which are used by the packages generated by
26+ \module {gensuitemodule} to populate the classes and properties in a
27+ given suite.
28+
29+ For reasons of backward compatibility, and for cases where you need to
30+ script an application for which you have not generated the stub package
31+ this module also contains object specifiers for a number of common OSA
32+ classes such as \code {Document}, \code {Window}, \code {Character}, etc.
33+
34+
35+
36+ The \module {AEObjects} module defines the following classes to represent
37+ Apple Event descriptor data:
38+
39+ \begin {classdesc }{Unknown}{type, data}
40+ The representation of OSA descriptor data for which the \module {aepack}
41+ and \module {aetypes} modules have no support, i.e. anything that is not
42+ represented by the other classes here and that is not equivalent to a
43+ simple Python value.
44+ \end {classdesc }
45+
46+ \begin {classdesc }{Enum}{enum}
47+ An enumeration value with the given 4-character string value.
48+ \end {classdesc }
49+
50+ \begin {classdesc }{InsertionLoc}{of, pos}
51+ Position \code {pos} in object \code {of}.
52+ \end {classdesc }
53+
54+ \begin {classdesc }{Boolean}{bool}
55+ A boolean.
56+ \end {classdesc }
57+
58+ \begin {classdesc }{StyledText}{style, text}
59+ Text with style information (font, face, etc) included.
60+ \end {classdesc }
61+
62+ \begin {classdesc }{AEText}{script, style, text}
63+ Text with script system and style information included.
64+ \end {classdesc }
65+
66+ \begin {classdesc }{IntlText}{script, language, text}
67+ Text with script system and language information included.
68+ \end {classdesc }
69+
70+ \begin {classdesc }{IntlWritingCode}{script, language}
71+ Script system and language information.
72+ \end {classdesc }
73+
74+ \begin {classdesc }{QDPoint}{v, h}
75+ A quickdraw point.
76+ \end {classdesc }
77+
78+ \begin {classdesc }{QDRectangle}{v0, h0, v1, h1}
79+ A quickdraw rectangle.
80+ \end {classdesc }
81+
82+ \begin {classdesc }{RGBColor}{r, g, b}
83+ A color.
84+ \end {classdesc }
85+
86+ \begin {classdesc }{Type}{type}
87+ An OSA type value with the given 4-character name.
88+ \end {classdesc }
89+
90+ \begin {classdesc }{Keyword}{name}
91+ An OSA keyword with the given 4-character name.
92+ \end {classdesc }
93+
94+ \begin {classdesc }{Range}{start, stop}
95+ A range.
96+ \end {classdesc }
97+
98+ \begin {classdesc }{Ordinal}{abso}
99+ Non-numeric absolute positions, such as \code {"firs"}, first, or \code {"midd"},
100+ middle.
101+ \end {classdesc }
102+
103+ \begin {classdesc }{Logical}{logc, term}
104+ The logical expression of applying operator \code {logc} to
105+ \code {term}.
106+ \end {classdesc }
107+
108+ \begin {classdesc }{Comparison}{obj1, relo, obj2}
109+ The comparison \code {relo} of \code {obj1} to \code {obj2}.
110+ \end {classdesc }
111+
112+ The following classes are used as base classes by the generated stub
113+ packages to represent AppleScript classes and properties in Python:
114+
115+ \begin {classdesc }{ComponentItem}{which\optional {, fr}}
116+ Abstract baseclass for an OSA class. The subclass should set the class
117+ attribute \code {want} to the 4-character OSA class code. Instances of
118+ subclasses of this class are equivalent to AppleScript Object
119+ Specifiers. 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}
124+ Abstract basclass for an OSA property. The subclass should set the class
125+ attributes \code {want} and \code {which} to designate which property we
126+ are talking about. Instances of subclasses of this class are Object
127+ Specifiers.
128+ \end {classdesc }
129+
130+ \begin {classdesc }{ObjectSpecifier}{want, form, seld\optional {, fr}}
131+ Base class of \code {ComponentItem} and \code {NProperty}, a general
132+ OSA Object Specifier. See the Apple Open Scripting Architecture
133+ documentation for the parameters. Note that this class is not abstract.
134+ \end {classdesc }
135+
0 commit comments