| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="STYLESHEET" href="mac.css" type='text/css' /> |
| 5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> |
| 6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> |
| 7 | <link rel="first" href="mac.html" title='Macintosh Library Modules' /> |
| 8 | <link rel='contents' href='contents.html' title="Contents" /> |
| 9 | <link rel='index' href='genindex.html' title='Index' /> |
| 10 | <link rel='last' href='about.html' title='About this document...' /> |
| 11 | <link rel='help' href='about.html' title='About this document...' /> |
| 12 | <link rel="next" href="module-MiniAEFrame.html" /> |
| 13 | <link rel="prev" href="module-aepack.html" /> |
| 14 | <link rel="parent" href="scripting.html" /> |
| 15 | <link rel="next" href="module-MiniAEFrame.html" /> |
| 16 | <meta name='aesop' content='information' /> |
| 17 | <title>3.4 aetypes -- AppleEvent objects</title> |
| 18 | </head> |
| 19 | <body> |
| 20 | <DIV CLASS="navigation"> |
| 21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> |
| 22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 23 | <tr> |
| 24 | <td class='online-navigation'><a rel="prev" title="3.3 aepack " |
| 25 | href="module-aepack.html"><img src='../icons/previous.png' |
| 26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 27 | <td class='online-navigation'><a rel="parent" title="3. MacPython OSA Modules" |
| 28 | href="scripting.html"><img src='../icons/up.png' |
| 29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 30 | <td class='online-navigation'><a rel="next" title="3.5 MiniAEFrame " |
| 31 | href="module-MiniAEFrame.html"><img src='../icons/next.png' |
| 32 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 33 | <td align="center" width="100%">Macintosh Library Modules</td> |
| 34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 35 | href="contents.html"><img src='../icons/contents.png' |
| 36 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 38 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 39 | <td class='online-navigation'><a rel="index" title="Index" |
| 40 | href="genindex.html"><img src='../icons/index.png' |
| 41 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 42 | </tr></table> |
| 43 | <div class='online-navigation'> |
| 44 | <b class="navlabel">Previous:</b> |
| 45 | <a class="sectref" rel="prev" href="module-aepack.html">3.3 aepack </A> |
| 46 | <b class="navlabel">Up:</b> |
| 47 | <a class="sectref" rel="parent" href="scripting.html">3. MacPython OSA Modules</A> |
| 48 | <b class="navlabel">Next:</b> |
| 49 | <a class="sectref" rel="next" href="module-MiniAEFrame.html">3.5 MiniAEFrame </A> |
| 50 | </div> |
| 51 | <hr /></div> |
| 52 | </DIV> |
| 53 | <!--End of Navigation Panel--> |
| 54 | |
| 55 | <H1><A NAME="SECTION005400000000000000000"> |
| 56 | 3.4 <tt class="module">aetypes</tt> -- |
| 57 | AppleEvent objects</A> |
| 58 | </H1> |
| 59 | |
| 60 | <P> |
| 61 | <A NAME="module-aetypes"></A> |
| 62 | <p class="availability">Availability: <span |
| 63 | class="platform">Macintosh</span>.</p> |
| 64 | |
| 65 | <P> |
| 66 | The <tt class="module">aetypes</tt> defines classes used to represent Apple Event data |
| 67 | descriptors and Apple Event object specifiers. |
| 68 | |
| 69 | <P> |
| 70 | Apple Event data is contained in descriptors, and these descriptors |
| 71 | are typed. For many descriptors the Python representation is simply the |
| 72 | corresponding Python type: <code>typeText</code> in OSA is a Python string, |
| 73 | <code>typeFloat</code> is a float, etc. For OSA types that have no direct |
| 74 | Python counterpart this module declares classes. Packing and unpacking |
| 75 | instances of these classes is handled automatically by <tt class="module">aepack</tt>. |
| 76 | |
| 77 | <P> |
| 78 | An object specifier is essentially an address of an object implemented |
| 79 | in a Apple Event server. An Apple Event specifier is used as the direct |
| 80 | object for an Apple Event or as the argument of an optional parameter. |
| 81 | The <tt class="module">aetypes</tt> module contains the base classes for OSA classes |
| 82 | and properties, which are used by the packages generated by |
| 83 | <tt class="module">gensuitemodule</tt> to populate the classes and properties in a |
| 84 | given suite. |
| 85 | |
| 86 | <P> |
| 87 | For reasons of backward compatibility, and for cases where you need to |
| 88 | script an application for which you have not generated the stub package |
| 89 | this module also contains object specifiers for a number of common OSA |
| 90 | classes such as <code>Document</code>, <code>Window</code>, <code>Character</code>, etc. |
| 91 | |
| 92 | <P> |
| 93 | The <tt class="module">AEObjects</tt> module defines the following classes to represent |
| 94 | Apple Event descriptor data: |
| 95 | |
| 96 | <P> |
| 97 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 98 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-153' xml:id='l2h-153' class="class">Unknown</tt></b>(</nobr></td> |
| 99 | <td><var>type, data</var>)</td></tr></table></dt> |
| 100 | <dd> |
| 101 | The representation of OSA descriptor data for which the <tt class="module">aepack</tt> |
| 102 | and <tt class="module">aetypes</tt> modules have no support, i.e. anything that is not |
| 103 | represented by the other classes here and that is not equivalent to a |
| 104 | simple Python value. |
| 105 | </dl> |
| 106 | |
| 107 | <P> |
| 108 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 109 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-154' xml:id='l2h-154' class="class">Enum</tt></b>(</nobr></td> |
| 110 | <td><var>enum</var>)</td></tr></table></dt> |
| 111 | <dd> |
| 112 | An enumeration value with the given 4-character string value. |
| 113 | </dl> |
| 114 | |
| 115 | <P> |
| 116 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 117 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-155' xml:id='l2h-155' class="class">InsertionLoc</tt></b>(</nobr></td> |
| 118 | <td><var>of, pos</var>)</td></tr></table></dt> |
| 119 | <dd> |
| 120 | Position <code>pos</code> in object <code>of</code>. |
| 121 | </dl> |
| 122 | |
| 123 | <P> |
| 124 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 125 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-156' xml:id='l2h-156' class="class">Boolean</tt></b>(</nobr></td> |
| 126 | <td><var>bool</var>)</td></tr></table></dt> |
| 127 | <dd> |
| 128 | A boolean. |
| 129 | </dl> |
| 130 | |
| 131 | <P> |
| 132 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 133 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-157' xml:id='l2h-157' class="class">StyledText</tt></b>(</nobr></td> |
| 134 | <td><var>style, text</var>)</td></tr></table></dt> |
| 135 | <dd> |
| 136 | Text with style information (font, face, etc) included. |
| 137 | </dl> |
| 138 | |
| 139 | <P> |
| 140 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 141 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-158' xml:id='l2h-158' class="class">AEText</tt></b>(</nobr></td> |
| 142 | <td><var>script, style, text</var>)</td></tr></table></dt> |
| 143 | <dd> |
| 144 | Text with script system and style information included. |
| 145 | </dl> |
| 146 | |
| 147 | <P> |
| 148 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 149 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-159' xml:id='l2h-159' class="class">IntlText</tt></b>(</nobr></td> |
| 150 | <td><var>script, language, text</var>)</td></tr></table></dt> |
| 151 | <dd> |
| 152 | Text with script system and language information included. |
| 153 | </dl> |
| 154 | |
| 155 | <P> |
| 156 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 157 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-160' xml:id='l2h-160' class="class">IntlWritingCode</tt></b>(</nobr></td> |
| 158 | <td><var>script, language</var>)</td></tr></table></dt> |
| 159 | <dd> |
| 160 | Script system and language information. |
| 161 | </dl> |
| 162 | |
| 163 | <P> |
| 164 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 165 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-161' xml:id='l2h-161' class="class">QDPoint</tt></b>(</nobr></td> |
| 166 | <td><var>v, h</var>)</td></tr></table></dt> |
| 167 | <dd> |
| 168 | A quickdraw point. |
| 169 | </dl> |
| 170 | |
| 171 | <P> |
| 172 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 173 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-162' xml:id='l2h-162' class="class">QDRectangle</tt></b>(</nobr></td> |
| 174 | <td><var>v0, h0, v1, h1</var>)</td></tr></table></dt> |
| 175 | <dd> |
| 176 | A quickdraw rectangle. |
| 177 | </dl> |
| 178 | |
| 179 | <P> |
| 180 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 181 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-163' xml:id='l2h-163' class="class">RGBColor</tt></b>(</nobr></td> |
| 182 | <td><var>r, g, b</var>)</td></tr></table></dt> |
| 183 | <dd> |
| 184 | A color. |
| 185 | </dl> |
| 186 | |
| 187 | <P> |
| 188 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 189 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-164' xml:id='l2h-164' class="class">Type</tt></b>(</nobr></td> |
| 190 | <td><var>type</var>)</td></tr></table></dt> |
| 191 | <dd> |
| 192 | An OSA type value with the given 4-character name. |
| 193 | </dl> |
| 194 | |
| 195 | <P> |
| 196 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 197 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-165' xml:id='l2h-165' class="class">Keyword</tt></b>(</nobr></td> |
| 198 | <td><var>name</var>)</td></tr></table></dt> |
| 199 | <dd> |
| 200 | An OSA keyword with the given 4-character name. |
| 201 | </dl> |
| 202 | |
| 203 | <P> |
| 204 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 205 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-166' xml:id='l2h-166' class="class">Range</tt></b>(</nobr></td> |
| 206 | <td><var>start, stop</var>)</td></tr></table></dt> |
| 207 | <dd> |
| 208 | A range. |
| 209 | </dl> |
| 210 | |
| 211 | <P> |
| 212 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 213 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-167' xml:id='l2h-167' class="class">Ordinal</tt></b>(</nobr></td> |
| 214 | <td><var>abso</var>)</td></tr></table></dt> |
| 215 | <dd> |
| 216 | Non-numeric absolute positions, such as <code>"firs"</code>, first, or <code>"midd"</code>, |
| 217 | middle. |
| 218 | </dl> |
| 219 | |
| 220 | <P> |
| 221 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 222 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-168' xml:id='l2h-168' class="class">Logical</tt></b>(</nobr></td> |
| 223 | <td><var>logc, term</var>)</td></tr></table></dt> |
| 224 | <dd> |
| 225 | The logical expression of applying operator <code>logc</code> to |
| 226 | <code>term</code>. |
| 227 | </dl> |
| 228 | |
| 229 | <P> |
| 230 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 231 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-169' xml:id='l2h-169' class="class">Comparison</tt></b>(</nobr></td> |
| 232 | <td><var>obj1, relo, obj2</var>)</td></tr></table></dt> |
| 233 | <dd> |
| 234 | The comparison <code>relo</code> of <code>obj1</code> to <code>obj2</code>. |
| 235 | </dl> |
| 236 | |
| 237 | <P> |
| 238 | The following classes are used as base classes by the generated stub |
| 239 | packages to represent AppleScript classes and properties in Python: |
| 240 | |
| 241 | <P> |
| 242 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 243 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-170' xml:id='l2h-170' class="class">ComponentItem</tt></b>(</nobr></td> |
| 244 | <td><var>which</var><big>[</big><var>, fr</var><big>]</big><var></var>)</td></tr></table></dt> |
| 245 | <dd> |
| 246 | Abstract baseclass for an OSA class. The subclass should set the class |
| 247 | attribute <code>want</code> to the 4-character OSA class code. Instances of |
| 248 | subclasses of this class are equivalent to AppleScript Object |
| 249 | Specifiers. Upon instantiation you should pass a selector in |
| 250 | <code>which</code>, and optionally a parent object in <code>fr</code>. |
| 251 | </dl> |
| 252 | |
| 253 | <P> |
| 254 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 255 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-171' xml:id='l2h-171' class="class">NProperty</tt></b>(</nobr></td> |
| 256 | <td><var>fr</var>)</td></tr></table></dt> |
| 257 | <dd> |
| 258 | Abstract baseclass for an OSA property. The subclass should set the class |
| 259 | attributes <code>want</code> and <code>which</code> to designate which property we |
| 260 | are talking about. Instances of subclasses of this class are Object |
| 261 | Specifiers. |
| 262 | </dl> |
| 263 | |
| 264 | <P> |
| 265 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 266 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-172' xml:id='l2h-172' class="class">ObjectSpecifier</tt></b>(</nobr></td> |
| 267 | <td><var>want, form, seld</var><big>[</big><var>, fr</var><big>]</big><var></var>)</td></tr></table></dt> |
| 268 | <dd> |
| 269 | Base class of <code>ComponentItem</code> and <code>NProperty</code>, a general |
| 270 | OSA Object Specifier. See the Apple Open Scripting Architecture |
| 271 | documentation for the parameters. Note that this class is not abstract. |
| 272 | </dl> |
| 273 | |
| 274 | <DIV CLASS="navigation"> |
| 275 | <div class='online-navigation'> |
| 276 | <p></p><hr /> |
| 277 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 278 | <tr> |
| 279 | <td class='online-navigation'><a rel="prev" title="3.3 aepack " |
| 280 | href="module-aepack.html"><img src='../icons/previous.png' |
| 281 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 282 | <td class='online-navigation'><a rel="parent" title="3. MacPython OSA Modules" |
| 283 | href="scripting.html"><img src='../icons/up.png' |
| 284 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 285 | <td class='online-navigation'><a rel="next" title="3.5 MiniAEFrame " |
| 286 | href="module-MiniAEFrame.html"><img src='../icons/next.png' |
| 287 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 288 | <td align="center" width="100%">Macintosh Library Modules</td> |
| 289 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 290 | href="contents.html"><img src='../icons/contents.png' |
| 291 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 292 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 293 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 294 | <td class='online-navigation'><a rel="index" title="Index" |
| 295 | href="genindex.html"><img src='../icons/index.png' |
| 296 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 297 | </tr></table> |
| 298 | <div class='online-navigation'> |
| 299 | <b class="navlabel">Previous:</b> |
| 300 | <a class="sectref" rel="prev" href="module-aepack.html">3.3 aepack </A> |
| 301 | <b class="navlabel">Up:</b> |
| 302 | <a class="sectref" rel="parent" href="scripting.html">3. MacPython OSA Modules</A> |
| 303 | <b class="navlabel">Next:</b> |
| 304 | <a class="sectref" rel="next" href="module-MiniAEFrame.html">3.5 MiniAEFrame </A> |
| 305 | </div> |
| 306 | </div> |
| 307 | <hr /> |
| 308 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 309 | </DIV> |
| 310 | <!--End of Navigation Panel--> |
| 311 | <ADDRESS> |
| 312 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 313 | </ADDRESS> |
| 314 | </BODY> |
| 315 | </HTML> |