Fred Drake | 1bd905e | 2000-10-14 05:06:24 +0000 | [diff] [blame] | 1 | \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 Jansen | bae5c96 | 2003-04-11 15:35:28 +0000 | [diff] [blame] | 11 | The \module{aetypes} defines classes used to represent Apple Event data |
| 12 | descriptors and Apple Event object specifiers. |
| 13 | |
Raymond Hettinger | 92016dc | 2003-09-22 15:27:11 +0000 | [diff] [blame] | 14 | Apple Event data is contained in descriptors, and these descriptors |
Jack Jansen | bae5c96 | 2003-04-11 15:35:28 +0000 | [diff] [blame] | 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. |
Fred Drake | 1bd905e | 2000-10-14 05:06:24 +0000 | [diff] [blame] | 33 | |
| 34 | |
Fred Drake | 1bd905e | 2000-10-14 05:06:24 +0000 | [diff] [blame] | 35 | |
Jack Jansen | bae5c96 | 2003-04-11 15:35:28 +0000 | [diff] [blame] | 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. |
Fred Drake | 1bd905e | 2000-10-14 05:06:24 +0000 | [diff] [blame] | 44 | \end{classdesc} |
| 45 | |
Jack Jansen | bae5c96 | 2003-04-11 15:35:28 +0000 | [diff] [blame] | 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} |
Raymond Hettinger | 565ea5a | 2004-10-02 11:02:59 +0000 | [diff] [blame] | 124 | Abstract baseclass for an OSA property. The subclass should set the class |
Jack Jansen | bae5c96 | 2003-04-11 15:35:28 +0000 | [diff] [blame] | 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 | |