Issue #5170: Fixed regression caused when fixing #5768.
[python.git] / Doc / library / aetypes.rst
blob997203e7e5ddee1fec33997af325a0a97eb74c64
2 :mod:`aetypes` --- AppleEvent objects
3 =====================================
5 .. module:: aetypes
6    :platform: Mac
7    :synopsis: Python representation of the Apple Event Object Model.
8    :deprecated:
9 .. sectionauthor:: Vincent Marchetti <vincem@en.com>
10 .. moduleauthor:: Jack Jansen
12 The :mod:`aetypes` defines classes used to represent Apple Event data
13 descriptors and Apple Event object specifiers.
15 Apple Event data is contained in descriptors, and these descriptors are typed.
16 For many descriptors the Python representation is simply the corresponding
17 Python type: ``typeText`` in OSA is a Python string, ``typeFloat`` is a float,
18 etc. For OSA types that have no direct Python counterpart this module declares
19 classes. Packing and unpacking instances of these classes is handled
20 automatically by :mod:`aepack`.
22 An object specifier is essentially an address of an object implemented in a
23 Apple Event server. An Apple Event specifier is used as the direct object for an
24 Apple Event or as the argument of an optional parameter. The :mod:`aetypes`
25 module contains the base classes for OSA classes and properties, which are used
26 by the packages generated by :mod:`gensuitemodule` to populate the classes and
27 properties in a given suite.
29 For reasons of backward compatibility, and for cases where you need to script an
30 application for which you have not generated the stub package this module also
31 contains object specifiers for a number of common OSA classes such as
32 ``Document``, ``Window``, ``Character``, etc.
34 .. warning::
36    This module is removed in 3.0.
40 The :mod:`AEObjects` module defines the following classes to represent Apple
41 Event descriptor data:
44 .. class:: Unknown(type, data)
46    The representation of OSA descriptor data for which the :mod:`aepack` and
47    :mod:`aetypes` modules have no support, i.e. anything that is not represented by
48    the other classes here and that is not equivalent to a simple Python value.
51 .. class:: Enum(enum)
53    An enumeration value with the given 4-character string value.
56 .. class:: InsertionLoc(of, pos)
58    Position ``pos`` in object ``of``.
61 .. class:: Boolean(bool)
63    A boolean.
66 .. class:: StyledText(style, text)
68    Text with style information (font, face, etc) included.
71 .. class:: AEText(script, style, text)
73    Text with script system and style information included.
76 .. class:: IntlText(script, language, text)
78    Text with script system and language information included.
81 .. class:: IntlWritingCode(script, language)
83    Script system and language information.
86 .. class:: QDPoint(v, h)
88    A quickdraw point.
91 .. class:: QDRectangle(v0, h0, v1, h1)
93    A quickdraw rectangle.
96 .. class:: RGBColor(r, g, b)
98    A color.
101 .. class:: Type(type)
103    An OSA type value with the given 4-character name.
106 .. class:: Keyword(name)
108    An OSA keyword with the given 4-character name.
111 .. class:: Range(start, stop)
113    A range.
116 .. class:: Ordinal(abso)
118    Non-numeric absolute positions, such as ``"firs"``, first, or ``"midd"``,
119    middle.
122 .. class:: Logical(logc, term)
124    The logical expression of applying operator ``logc`` to ``term``.
127 .. class:: Comparison(obj1, relo, obj2)
129    The comparison ``relo`` of ``obj1`` to ``obj2``.
131 The following classes are used as base classes by the generated stub packages to
132 represent AppleScript classes and properties in Python:
135 .. class:: ComponentItem(which[, fr])
137    Abstract baseclass for an OSA class. The subclass should set the class attribute
138    ``want`` to the 4-character OSA class code. Instances of subclasses of this
139    class are equivalent to AppleScript Object Specifiers. Upon instantiation you
140    should pass a selector in ``which``, and optionally a parent object in ``fr``.
143 .. class:: NProperty(fr)
145    Abstract baseclass for an OSA property. The subclass should set the class
146    attributes ``want`` and ``which`` to designate which property we are talking
147    about. Instances of subclasses of this class are Object Specifiers.
150 .. class:: ObjectSpecifier(want, form, seld[, fr])
152    Base class of ``ComponentItem`` and ``NProperty``, a general OSA Object
153    Specifier. See the Apple Open Scripting Architecture documentation for the
154    parameters. Note that this class is not abstract.