2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
:mod:`aetypes` --- AppleEvent objects
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
.. module:: aetypes
|
|
|
|
:platform: Mac
|
|
|
|
:synopsis: Python representation of the Apple Event Object Model.
|
|
|
|
.. sectionauthor:: Vincent Marchetti <vincem@en.com>
|
Merged revisions 59605-59624 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59606 | georg.brandl | 2007-12-29 11:57:00 +0100 (Sat, 29 Dec 2007) | 2 lines
Some cleanup in the docs.
........
r59611 | martin.v.loewis | 2007-12-29 19:49:21 +0100 (Sat, 29 Dec 2007) | 2 lines
Bug #1699: Define _BSD_SOURCE only on OpenBSD.
........
r59612 | raymond.hettinger | 2007-12-29 23:09:34 +0100 (Sat, 29 Dec 2007) | 1 line
Simpler documentation for itertools.tee(). Should be backported.
........
r59613 | raymond.hettinger | 2007-12-29 23:16:24 +0100 (Sat, 29 Dec 2007) | 1 line
Improve docs for itertools.groupby(). The use of xrange(0) to create a unique object is less obvious than object().
........
r59620 | christian.heimes | 2007-12-31 15:47:07 +0100 (Mon, 31 Dec 2007) | 3 lines
Added wininst-9.0.exe executable for VS 2008
Integrated bdist_wininst into PCBuild9 directory
........
r59621 | christian.heimes | 2007-12-31 15:51:18 +0100 (Mon, 31 Dec 2007) | 1 line
Moved PCbuild directory to PC/VS7.1
........
r59622 | christian.heimes | 2007-12-31 15:59:26 +0100 (Mon, 31 Dec 2007) | 1 line
Fix paths for build bot
........
r59623 | christian.heimes | 2007-12-31 16:02:41 +0100 (Mon, 31 Dec 2007) | 1 line
Fix paths for build bot, part 2
........
r59624 | christian.heimes | 2007-12-31 16:18:55 +0100 (Mon, 31 Dec 2007) | 1 line
Renamed PCBuild9 directory to PCBuild
........
2007-12-31 12:14:33 -04:00
|
|
|
.. moduleauthor:: Jack Jansen
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
The :mod:`aetypes` defines classes used to represent Apple Event data
|
|
|
|
descriptors and Apple Event object specifiers.
|
|
|
|
|
|
|
|
Apple Event data is contained in descriptors, and these descriptors are typed.
|
|
|
|
For many descriptors the Python representation is simply the corresponding
|
|
|
|
Python type: ``typeText`` in OSA is a Python string, ``typeFloat`` is a float,
|
|
|
|
etc. For OSA types that have no direct Python counterpart this module declares
|
|
|
|
classes. Packing and unpacking instances of these classes is handled
|
|
|
|
automatically by :mod:`aepack`.
|
|
|
|
|
|
|
|
An object specifier is essentially an address of an object implemented in a
|
|
|
|
Apple Event server. An Apple Event specifier is used as the direct object for an
|
|
|
|
Apple Event or as the argument of an optional parameter. The :mod:`aetypes`
|
|
|
|
module contains the base classes for OSA classes and properties, which are used
|
|
|
|
by the packages generated by :mod:`gensuitemodule` to populate the classes and
|
|
|
|
properties in a given suite.
|
|
|
|
|
|
|
|
For reasons of backward compatibility, and for cases where you need to script an
|
|
|
|
application for which you have not generated the stub package this module also
|
|
|
|
contains object specifiers for a number of common OSA classes such as
|
|
|
|
``Document``, ``Window``, ``Character``, etc.
|
|
|
|
|
|
|
|
The :mod:`AEObjects` module defines the following classes to represent Apple
|
|
|
|
Event descriptor data:
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: Unknown(type, data)
|
|
|
|
|
|
|
|
The representation of OSA descriptor data for which the :mod:`aepack` and
|
|
|
|
:mod:`aetypes` modules have no support, i.e. anything that is not represented by
|
|
|
|
the other classes here and that is not equivalent to a simple Python value.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: Enum(enum)
|
|
|
|
|
|
|
|
An enumeration value with the given 4-character string value.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: InsertionLoc(of, pos)
|
|
|
|
|
|
|
|
Position ``pos`` in object ``of``.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: Boolean(bool)
|
|
|
|
|
|
|
|
A boolean.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: StyledText(style, text)
|
|
|
|
|
|
|
|
Text with style information (font, face, etc) included.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: AEText(script, style, text)
|
|
|
|
|
|
|
|
Text with script system and style information included.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: IntlText(script, language, text)
|
|
|
|
|
|
|
|
Text with script system and language information included.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: IntlWritingCode(script, language)
|
|
|
|
|
|
|
|
Script system and language information.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: QDPoint(v, h)
|
|
|
|
|
|
|
|
A quickdraw point.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: QDRectangle(v0, h0, v1, h1)
|
|
|
|
|
|
|
|
A quickdraw rectangle.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: RGBColor(r, g, b)
|
|
|
|
|
|
|
|
A color.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: Type(type)
|
|
|
|
|
|
|
|
An OSA type value with the given 4-character name.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: Keyword(name)
|
|
|
|
|
|
|
|
An OSA keyword with the given 4-character name.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: Range(start, stop)
|
|
|
|
|
|
|
|
A range.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: Ordinal(abso)
|
|
|
|
|
|
|
|
Non-numeric absolute positions, such as ``"firs"``, first, or ``"midd"``,
|
|
|
|
middle.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: Logical(logc, term)
|
|
|
|
|
|
|
|
The logical expression of applying operator ``logc`` to ``term``.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: Comparison(obj1, relo, obj2)
|
|
|
|
|
|
|
|
The comparison ``relo`` of ``obj1`` to ``obj2``.
|
|
|
|
|
|
|
|
The following classes are used as base classes by the generated stub packages to
|
|
|
|
represent AppleScript classes and properties in Python:
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: ComponentItem(which[, fr])
|
|
|
|
|
|
|
|
Abstract baseclass for an OSA class. The subclass should set the class attribute
|
|
|
|
``want`` to the 4-character OSA class code. Instances of subclasses of this
|
|
|
|
class are equivalent to AppleScript Object Specifiers. Upon instantiation you
|
|
|
|
should pass a selector in ``which``, and optionally a parent object in ``fr``.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: NProperty(fr)
|
|
|
|
|
|
|
|
Abstract baseclass for an OSA property. The subclass should set the class
|
|
|
|
attributes ``want`` and ``which`` to designate which property we are talking
|
|
|
|
about. Instances of subclasses of this class are Object Specifiers.
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: ObjectSpecifier(want, form, seld[, fr])
|
|
|
|
|
|
|
|
Base class of ``ComponentItem`` and ``NProperty``, a general OSA Object
|
|
|
|
Specifier. See the Apple Open Scripting Architecture documentation for the
|
|
|
|
parameters. Note that this class is not abstract.
|
|
|
|
|