1 2:mod:`aetypes` --- AppleEvent objects 3===================================== 4 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 11 12The :mod:`aetypes` defines classes used to represent Apple Event data 13descriptors and Apple Event object specifiers. 14 15Apple Event data is contained in descriptors, and these descriptors are typed. 16For many descriptors the Python representation is simply the corresponding 17Python type: ``typeText`` in OSA is a Python string, ``typeFloat`` is a float, 18etc. For OSA types that have no direct Python counterpart this module declares 19classes. Packing and unpacking instances of these classes is handled 20automatically by :mod:`aepack`. 21 22An object specifier is essentially an address of an object implemented in an 23Apple Event server. An Apple Event specifier is used as the direct object for an 24Apple Event or as the argument of an optional parameter. The :mod:`aetypes` 25module contains the base classes for OSA classes and properties, which are used 26by the packages generated by :mod:`gensuitemodule` to populate the classes and 27properties in a given suite. 28 29For reasons of backward compatibility, and for cases where you need to script an 30application for which you have not generated the stub package this module also 31contains object specifiers for a number of common OSA classes such as 32``Document``, ``Window``, ``Character``, etc. 33 34.. note:: 35 36 This module has been removed in Python 3.x. 37 38 39 40The :mod:`AEObjects` module defines the following classes to represent Apple 41Event descriptor data: 42 43 44.. class:: Unknown(type, data) 45 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. 49 50 51.. class:: Enum(enum) 52 53 An enumeration value with the given 4-character string value. 54 55 56.. class:: InsertionLoc(of, pos) 57 58 Position ``pos`` in object ``of``. 59 60 61.. class:: Boolean(bool) 62 63 A boolean. 64 65 66.. class:: StyledText(style, text) 67 68 Text with style information (font, face, etc) included. 69 70 71.. class:: AEText(script, style, text) 72 73 Text with script system and style information included. 74 75 76.. class:: IntlText(script, language, text) 77 78 Text with script system and language information included. 79 80 81.. class:: IntlWritingCode(script, language) 82 83 Script system and language information. 84 85 86.. class:: QDPoint(v, h) 87 88 A quickdraw point. 89 90 91.. class:: QDRectangle(v0, h0, v1, h1) 92 93 A quickdraw rectangle. 94 95 96.. class:: RGBColor(r, g, b) 97 98 A color. 99 100 101.. class:: Type(type) 102 103 An OSA type value with the given 4-character name. 104 105 106.. class:: Keyword(name) 107 108 An OSA keyword with the given 4-character name. 109 110 111.. class:: Range(start, stop) 112 113 A range. 114 115 116.. class:: Ordinal(abso) 117 118 Non-numeric absolute positions, such as ``"firs"``, first, or ``"midd"``, 119 middle. 120 121 122.. class:: Logical(logc, term) 123 124 The logical expression of applying operator ``logc`` to ``term``. 125 126 127.. class:: Comparison(obj1, relo, obj2) 128 129 The comparison ``relo`` of ``obj1`` to ``obj2``. 130 131The following classes are used as base classes by the generated stub packages to 132represent AppleScript classes and properties in Python: 133 134 135.. class:: ComponentItem(which[, fr]) 136 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``. 141 142 143.. class:: NProperty(fr) 144 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. 148 149 150.. class:: ObjectSpecifier(want, form, seld[, fr]) 151 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. 155 156