| 1 | n/a | """Suite Standard Suite: Common terms for most applications |
|---|
| 2 | n/a | Level 1, version 1 |
|---|
| 3 | n/a | |
|---|
| 4 | n/a | Generated from /Volumes/Sap/System Folder/Extensions/AppleScript |
|---|
| 5 | n/a | AETE/AEUT resource version 1/0, language 0, script 0 |
|---|
| 6 | n/a | """ |
|---|
| 7 | n/a | |
|---|
| 8 | n/a | import aetools |
|---|
| 9 | n/a | import MacOS |
|---|
| 10 | n/a | |
|---|
| 11 | n/a | _code = 'core' |
|---|
| 12 | n/a | |
|---|
| 13 | n/a | from _builtinSuites.builtin_Suite import * |
|---|
| 14 | n/a | class Standard_Suite_Events(builtin_Suite_Events): |
|---|
| 15 | n/a | |
|---|
| 16 | n/a | _argmap_class_info = { |
|---|
| 17 | n/a | 'in_' : 'wrcd', |
|---|
| 18 | n/a | } |
|---|
| 19 | n/a | |
|---|
| 20 | n/a | def class_info(self, _object=None, _attributes={}, **_arguments): |
|---|
| 21 | n/a | """class info: (optional) Get information about an object class |
|---|
| 22 | n/a | Required argument: the object class about which information is requested |
|---|
| 23 | n/a | Keyword argument in_: the human language and script system in which to return information |
|---|
| 24 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 25 | n/a | Returns: a record containing the object\xd5s properties and elements |
|---|
| 26 | n/a | """ |
|---|
| 27 | n/a | _code = 'core' |
|---|
| 28 | n/a | _subcode = 'qobj' |
|---|
| 29 | n/a | |
|---|
| 30 | n/a | aetools.keysubst(_arguments, self._argmap_class_info) |
|---|
| 31 | n/a | _arguments['----'] = _object |
|---|
| 32 | n/a | |
|---|
| 33 | n/a | |
|---|
| 34 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 35 | n/a | _arguments, _attributes) |
|---|
| 36 | n/a | if _arguments.get('errn', 0): |
|---|
| 37 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 38 | n/a | # XXXX Optionally decode result |
|---|
| 39 | n/a | if _arguments.has_key('----'): |
|---|
| 40 | n/a | return _arguments['----'] |
|---|
| 41 | n/a | |
|---|
| 42 | n/a | _argmap_close = { |
|---|
| 43 | n/a | 'saving' : 'savo', |
|---|
| 44 | n/a | 'saving_in' : 'kfil', |
|---|
| 45 | n/a | } |
|---|
| 46 | n/a | |
|---|
| 47 | n/a | def close(self, _object, _attributes={}, **_arguments): |
|---|
| 48 | n/a | """close: Close an object |
|---|
| 49 | n/a | Required argument: the object to close |
|---|
| 50 | n/a | Keyword argument saving: specifies whether changes should be saved before closing |
|---|
| 51 | n/a | Keyword argument saving_in: the file or alias in which to save the object |
|---|
| 52 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 53 | n/a | """ |
|---|
| 54 | n/a | _code = 'core' |
|---|
| 55 | n/a | _subcode = 'clos' |
|---|
| 56 | n/a | |
|---|
| 57 | n/a | aetools.keysubst(_arguments, self._argmap_close) |
|---|
| 58 | n/a | _arguments['----'] = _object |
|---|
| 59 | n/a | |
|---|
| 60 | n/a | aetools.enumsubst(_arguments, 'savo', _Enum_savo) |
|---|
| 61 | n/a | |
|---|
| 62 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 63 | n/a | _arguments, _attributes) |
|---|
| 64 | n/a | if _arguments.get('errn', 0): |
|---|
| 65 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 66 | n/a | # XXXX Optionally decode result |
|---|
| 67 | n/a | if _arguments.has_key('----'): |
|---|
| 68 | n/a | return _arguments['----'] |
|---|
| 69 | n/a | |
|---|
| 70 | n/a | _argmap_count = { |
|---|
| 71 | n/a | 'each' : 'kocl', |
|---|
| 72 | n/a | } |
|---|
| 73 | n/a | |
|---|
| 74 | n/a | def count(self, _object, _attributes={}, **_arguments): |
|---|
| 75 | n/a | """count: Return the number of elements of an object |
|---|
| 76 | n/a | Required argument: the object whose elements are to be counted |
|---|
| 77 | n/a | Keyword argument each: if specified, restricts counting to objects of this class |
|---|
| 78 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 79 | n/a | Returns: the number of elements |
|---|
| 80 | n/a | """ |
|---|
| 81 | n/a | _code = 'core' |
|---|
| 82 | n/a | _subcode = 'cnte' |
|---|
| 83 | n/a | |
|---|
| 84 | n/a | aetools.keysubst(_arguments, self._argmap_count) |
|---|
| 85 | n/a | _arguments['----'] = _object |
|---|
| 86 | n/a | |
|---|
| 87 | n/a | |
|---|
| 88 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 89 | n/a | _arguments, _attributes) |
|---|
| 90 | n/a | if _arguments.get('errn', 0): |
|---|
| 91 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 92 | n/a | # XXXX Optionally decode result |
|---|
| 93 | n/a | if _arguments.has_key('----'): |
|---|
| 94 | n/a | return _arguments['----'] |
|---|
| 95 | n/a | |
|---|
| 96 | n/a | _argmap_data_size = { |
|---|
| 97 | n/a | 'as' : 'rtyp', |
|---|
| 98 | n/a | } |
|---|
| 99 | n/a | |
|---|
| 100 | n/a | def data_size(self, _object, _attributes={}, **_arguments): |
|---|
| 101 | n/a | """data size: (optional) Return the size in bytes of an object |
|---|
| 102 | n/a | Required argument: the object whose data size is to be returned |
|---|
| 103 | n/a | Keyword argument as: the data type for which the size is calculated |
|---|
| 104 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 105 | n/a | Returns: the size of the object in bytes |
|---|
| 106 | n/a | """ |
|---|
| 107 | n/a | _code = 'core' |
|---|
| 108 | n/a | _subcode = 'dsiz' |
|---|
| 109 | n/a | |
|---|
| 110 | n/a | aetools.keysubst(_arguments, self._argmap_data_size) |
|---|
| 111 | n/a | _arguments['----'] = _object |
|---|
| 112 | n/a | |
|---|
| 113 | n/a | |
|---|
| 114 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 115 | n/a | _arguments, _attributes) |
|---|
| 116 | n/a | if _arguments.get('errn', 0): |
|---|
| 117 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 118 | n/a | # XXXX Optionally decode result |
|---|
| 119 | n/a | if _arguments.has_key('----'): |
|---|
| 120 | n/a | return _arguments['----'] |
|---|
| 121 | n/a | |
|---|
| 122 | n/a | def delete(self, _object, _attributes={}, **_arguments): |
|---|
| 123 | n/a | """delete: Delete an object from its container. Note this does not work on script variables, only on elements of application classes. |
|---|
| 124 | n/a | Required argument: the element to delete |
|---|
| 125 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 126 | n/a | """ |
|---|
| 127 | n/a | _code = 'core' |
|---|
| 128 | n/a | _subcode = 'delo' |
|---|
| 129 | n/a | |
|---|
| 130 | n/a | if _arguments: raise TypeError, 'No optional args expected' |
|---|
| 131 | n/a | _arguments['----'] = _object |
|---|
| 132 | n/a | |
|---|
| 133 | n/a | |
|---|
| 134 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 135 | n/a | _arguments, _attributes) |
|---|
| 136 | n/a | if _arguments.get('errn', 0): |
|---|
| 137 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 138 | n/a | # XXXX Optionally decode result |
|---|
| 139 | n/a | if _arguments.has_key('----'): |
|---|
| 140 | n/a | return _arguments['----'] |
|---|
| 141 | n/a | |
|---|
| 142 | n/a | _argmap_duplicate = { |
|---|
| 143 | n/a | 'to' : 'insh', |
|---|
| 144 | n/a | 'with_properties' : 'prdt', |
|---|
| 145 | n/a | } |
|---|
| 146 | n/a | |
|---|
| 147 | n/a | def duplicate(self, _object, _attributes={}, **_arguments): |
|---|
| 148 | n/a | """duplicate: Duplicate one or more objects |
|---|
| 149 | n/a | Required argument: the object(s) to duplicate |
|---|
| 150 | n/a | Keyword argument to: the new location for the object(s) |
|---|
| 151 | n/a | Keyword argument with_properties: the initial values for properties of the new object that are to be different from the original |
|---|
| 152 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 153 | n/a | Returns: to the duplicated object(s) |
|---|
| 154 | n/a | """ |
|---|
| 155 | n/a | _code = 'core' |
|---|
| 156 | n/a | _subcode = 'clon' |
|---|
| 157 | n/a | |
|---|
| 158 | n/a | aetools.keysubst(_arguments, self._argmap_duplicate) |
|---|
| 159 | n/a | _arguments['----'] = _object |
|---|
| 160 | n/a | |
|---|
| 161 | n/a | |
|---|
| 162 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 163 | n/a | _arguments, _attributes) |
|---|
| 164 | n/a | if _arguments.get('errn', 0): |
|---|
| 165 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 166 | n/a | # XXXX Optionally decode result |
|---|
| 167 | n/a | if _arguments.has_key('----'): |
|---|
| 168 | n/a | return _arguments['----'] |
|---|
| 169 | n/a | |
|---|
| 170 | n/a | _argmap_event_info = { |
|---|
| 171 | n/a | 'in_' : 'wrcd', |
|---|
| 172 | n/a | } |
|---|
| 173 | n/a | |
|---|
| 174 | n/a | def event_info(self, _object, _attributes={}, **_arguments): |
|---|
| 175 | n/a | """event info: (optional) Get information about the Apple events in a suite |
|---|
| 176 | n/a | Required argument: the event class of the Apple events for which to return information |
|---|
| 177 | n/a | Keyword argument in_: the human language and script system in which to return information |
|---|
| 178 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 179 | n/a | Returns: a record containing the events and their parameters |
|---|
| 180 | n/a | """ |
|---|
| 181 | n/a | _code = 'core' |
|---|
| 182 | n/a | _subcode = 'gtei' |
|---|
| 183 | n/a | |
|---|
| 184 | n/a | aetools.keysubst(_arguments, self._argmap_event_info) |
|---|
| 185 | n/a | _arguments['----'] = _object |
|---|
| 186 | n/a | |
|---|
| 187 | n/a | |
|---|
| 188 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 189 | n/a | _arguments, _attributes) |
|---|
| 190 | n/a | if _arguments.get('errn', 0): |
|---|
| 191 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 192 | n/a | # XXXX Optionally decode result |
|---|
| 193 | n/a | if _arguments.has_key('----'): |
|---|
| 194 | n/a | return _arguments['----'] |
|---|
| 195 | n/a | |
|---|
| 196 | n/a | def exists(self, _object, _attributes={}, **_arguments): |
|---|
| 197 | n/a | """exists: Verify if an object exists |
|---|
| 198 | n/a | Required argument: the object in question |
|---|
| 199 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 200 | n/a | Returns: true if it exists, false if not |
|---|
| 201 | n/a | """ |
|---|
| 202 | n/a | _code = 'core' |
|---|
| 203 | n/a | _subcode = 'doex' |
|---|
| 204 | n/a | |
|---|
| 205 | n/a | if _arguments: raise TypeError, 'No optional args expected' |
|---|
| 206 | n/a | _arguments['----'] = _object |
|---|
| 207 | n/a | |
|---|
| 208 | n/a | |
|---|
| 209 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 210 | n/a | _arguments, _attributes) |
|---|
| 211 | n/a | if _arguments.get('errn', 0): |
|---|
| 212 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 213 | n/a | # XXXX Optionally decode result |
|---|
| 214 | n/a | if _arguments.has_key('----'): |
|---|
| 215 | n/a | return _arguments['----'] |
|---|
| 216 | n/a | |
|---|
| 217 | n/a | def handleBreakpoint(self, _object, _attributes={}, **_arguments): |
|---|
| 218 | n/a | """handleBreakpoint: return true to stop at a breakpoint |
|---|
| 219 | n/a | Required argument: the call frame of the breakpoint |
|---|
| 220 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 221 | n/a | Returns: true to stop, false if not |
|---|
| 222 | n/a | """ |
|---|
| 223 | n/a | _code = 'core' |
|---|
| 224 | n/a | _subcode = 'brak' |
|---|
| 225 | n/a | |
|---|
| 226 | n/a | if _arguments: raise TypeError, 'No optional args expected' |
|---|
| 227 | n/a | _arguments['----'] = _object |
|---|
| 228 | n/a | |
|---|
| 229 | n/a | |
|---|
| 230 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 231 | n/a | _arguments, _attributes) |
|---|
| 232 | n/a | if _arguments.get('errn', 0): |
|---|
| 233 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 234 | n/a | # XXXX Optionally decode result |
|---|
| 235 | n/a | if _arguments.has_key('----'): |
|---|
| 236 | n/a | return _arguments['----'] |
|---|
| 237 | n/a | |
|---|
| 238 | n/a | _argmap_make = { |
|---|
| 239 | n/a | 'new' : 'kocl', |
|---|
| 240 | n/a | 'at' : 'insh', |
|---|
| 241 | n/a | 'with_data' : 'data', |
|---|
| 242 | n/a | 'with_properties' : 'prdt', |
|---|
| 243 | n/a | } |
|---|
| 244 | n/a | |
|---|
| 245 | n/a | def make(self, _no_object=None, _attributes={}, **_arguments): |
|---|
| 246 | n/a | """make: Make a new element |
|---|
| 247 | n/a | Keyword argument new: the class of the new element |
|---|
| 248 | n/a | Keyword argument at: the location at which to insert the element |
|---|
| 249 | n/a | Keyword argument with_data: the initial data for the element |
|---|
| 250 | n/a | Keyword argument with_properties: the initial values for the properties of the element |
|---|
| 251 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 252 | n/a | Returns: to the new object(s) |
|---|
| 253 | n/a | """ |
|---|
| 254 | n/a | _code = 'core' |
|---|
| 255 | n/a | _subcode = 'crel' |
|---|
| 256 | n/a | |
|---|
| 257 | n/a | aetools.keysubst(_arguments, self._argmap_make) |
|---|
| 258 | n/a | if _no_object is not None: raise TypeError, 'No direct arg expected' |
|---|
| 259 | n/a | |
|---|
| 260 | n/a | |
|---|
| 261 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 262 | n/a | _arguments, _attributes) |
|---|
| 263 | n/a | if _arguments.get('errn', 0): |
|---|
| 264 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 265 | n/a | # XXXX Optionally decode result |
|---|
| 266 | n/a | if _arguments.has_key('----'): |
|---|
| 267 | n/a | return _arguments['----'] |
|---|
| 268 | n/a | |
|---|
| 269 | n/a | _argmap_move = { |
|---|
| 270 | n/a | 'to' : 'insh', |
|---|
| 271 | n/a | } |
|---|
| 272 | n/a | |
|---|
| 273 | n/a | def move(self, _object, _attributes={}, **_arguments): |
|---|
| 274 | n/a | """move: Move object(s) to a new location |
|---|
| 275 | n/a | Required argument: the object(s) to move |
|---|
| 276 | n/a | Keyword argument to: the new location for the object(s) |
|---|
| 277 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 278 | n/a | Returns: to the object(s) after they have been moved |
|---|
| 279 | n/a | """ |
|---|
| 280 | n/a | _code = 'core' |
|---|
| 281 | n/a | _subcode = 'move' |
|---|
| 282 | n/a | |
|---|
| 283 | n/a | aetools.keysubst(_arguments, self._argmap_move) |
|---|
| 284 | n/a | _arguments['----'] = _object |
|---|
| 285 | n/a | |
|---|
| 286 | n/a | |
|---|
| 287 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 288 | n/a | _arguments, _attributes) |
|---|
| 289 | n/a | if _arguments.get('errn', 0): |
|---|
| 290 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 291 | n/a | # XXXX Optionally decode result |
|---|
| 292 | n/a | if _arguments.has_key('----'): |
|---|
| 293 | n/a | return _arguments['----'] |
|---|
| 294 | n/a | |
|---|
| 295 | n/a | def open(self, _object, _attributes={}, **_arguments): |
|---|
| 296 | n/a | """open: Open the specified object(s) |
|---|
| 297 | n/a | Required argument: list of objects to open |
|---|
| 298 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 299 | n/a | """ |
|---|
| 300 | n/a | _code = 'aevt' |
|---|
| 301 | n/a | _subcode = 'odoc' |
|---|
| 302 | n/a | |
|---|
| 303 | n/a | if _arguments: raise TypeError, 'No optional args expected' |
|---|
| 304 | n/a | _arguments['----'] = _object |
|---|
| 305 | n/a | |
|---|
| 306 | n/a | |
|---|
| 307 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 308 | n/a | _arguments, _attributes) |
|---|
| 309 | n/a | if _arguments.get('errn', 0): |
|---|
| 310 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 311 | n/a | # XXXX Optionally decode result |
|---|
| 312 | n/a | if _arguments.has_key('----'): |
|---|
| 313 | n/a | return _arguments['----'] |
|---|
| 314 | n/a | |
|---|
| 315 | n/a | def print_(self, _object, _attributes={}, **_arguments): |
|---|
| 316 | n/a | """print: Print the specified object(s) |
|---|
| 317 | n/a | Required argument: list of objects to print |
|---|
| 318 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 319 | n/a | """ |
|---|
| 320 | n/a | _code = 'aevt' |
|---|
| 321 | n/a | _subcode = 'pdoc' |
|---|
| 322 | n/a | |
|---|
| 323 | n/a | if _arguments: raise TypeError, 'No optional args expected' |
|---|
| 324 | n/a | _arguments['----'] = _object |
|---|
| 325 | n/a | |
|---|
| 326 | n/a | |
|---|
| 327 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 328 | n/a | _arguments, _attributes) |
|---|
| 329 | n/a | if _arguments.get('errn', 0): |
|---|
| 330 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 331 | n/a | # XXXX Optionally decode result |
|---|
| 332 | n/a | if _arguments.has_key('----'): |
|---|
| 333 | n/a | return _arguments['----'] |
|---|
| 334 | n/a | |
|---|
| 335 | n/a | _argmap_quit = { |
|---|
| 336 | n/a | 'saving' : 'savo', |
|---|
| 337 | n/a | } |
|---|
| 338 | n/a | |
|---|
| 339 | n/a | def quit(self, _no_object=None, _attributes={}, **_arguments): |
|---|
| 340 | n/a | """quit: Quit an application |
|---|
| 341 | n/a | Keyword argument saving: specifies whether to save currently open documents |
|---|
| 342 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 343 | n/a | """ |
|---|
| 344 | n/a | _code = 'aevt' |
|---|
| 345 | n/a | _subcode = 'quit' |
|---|
| 346 | n/a | |
|---|
| 347 | n/a | aetools.keysubst(_arguments, self._argmap_quit) |
|---|
| 348 | n/a | if _no_object is not None: raise TypeError, 'No direct arg expected' |
|---|
| 349 | n/a | |
|---|
| 350 | n/a | aetools.enumsubst(_arguments, 'savo', _Enum_savo) |
|---|
| 351 | n/a | |
|---|
| 352 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 353 | n/a | _arguments, _attributes) |
|---|
| 354 | n/a | if _arguments.get('errn', 0): |
|---|
| 355 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 356 | n/a | # XXXX Optionally decode result |
|---|
| 357 | n/a | if _arguments.has_key('----'): |
|---|
| 358 | n/a | return _arguments['----'] |
|---|
| 359 | n/a | |
|---|
| 360 | n/a | def reopen(self, _no_object=None, _attributes={}, **_arguments): |
|---|
| 361 | n/a | """reopen: Reactivate a running application. Some applications will open a new untitled window if no window is open. |
|---|
| 362 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 363 | n/a | """ |
|---|
| 364 | n/a | _code = 'aevt' |
|---|
| 365 | n/a | _subcode = 'rapp' |
|---|
| 366 | n/a | |
|---|
| 367 | n/a | if _arguments: raise TypeError, 'No optional args expected' |
|---|
| 368 | n/a | if _no_object is not None: raise TypeError, 'No direct arg expected' |
|---|
| 369 | n/a | |
|---|
| 370 | n/a | |
|---|
| 371 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 372 | n/a | _arguments, _attributes) |
|---|
| 373 | n/a | if _arguments.get('errn', 0): |
|---|
| 374 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 375 | n/a | # XXXX Optionally decode result |
|---|
| 376 | n/a | if _arguments.has_key('----'): |
|---|
| 377 | n/a | return _arguments['----'] |
|---|
| 378 | n/a | |
|---|
| 379 | n/a | def run(self, _no_object=None, _attributes={}, **_arguments): |
|---|
| 380 | n/a | """run: Run an application. Most applications will open an empty, untitled window. |
|---|
| 381 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 382 | n/a | """ |
|---|
| 383 | n/a | _code = 'aevt' |
|---|
| 384 | n/a | _subcode = 'oapp' |
|---|
| 385 | n/a | |
|---|
| 386 | n/a | if _arguments: raise TypeError, 'No optional args expected' |
|---|
| 387 | n/a | if _no_object is not None: raise TypeError, 'No direct arg expected' |
|---|
| 388 | n/a | |
|---|
| 389 | n/a | |
|---|
| 390 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 391 | n/a | _arguments, _attributes) |
|---|
| 392 | n/a | if _arguments.get('errn', 0): |
|---|
| 393 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 394 | n/a | # XXXX Optionally decode result |
|---|
| 395 | n/a | if _arguments.has_key('----'): |
|---|
| 396 | n/a | return _arguments['----'] |
|---|
| 397 | n/a | |
|---|
| 398 | n/a | _argmap_save = { |
|---|
| 399 | n/a | 'in_' : 'kfil', |
|---|
| 400 | n/a | 'as' : 'fltp', |
|---|
| 401 | n/a | } |
|---|
| 402 | n/a | |
|---|
| 403 | n/a | def save(self, _object, _attributes={}, **_arguments): |
|---|
| 404 | n/a | """save: Save an object |
|---|
| 405 | n/a | Required argument: the object to save, usually a document or window |
|---|
| 406 | n/a | Keyword argument in_: the file or alias in which to save the object |
|---|
| 407 | n/a | Keyword argument as: the file type of the document in which to save the data |
|---|
| 408 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 409 | n/a | """ |
|---|
| 410 | n/a | _code = 'core' |
|---|
| 411 | n/a | _subcode = 'save' |
|---|
| 412 | n/a | |
|---|
| 413 | n/a | aetools.keysubst(_arguments, self._argmap_save) |
|---|
| 414 | n/a | _arguments['----'] = _object |
|---|
| 415 | n/a | |
|---|
| 416 | n/a | |
|---|
| 417 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 418 | n/a | _arguments, _attributes) |
|---|
| 419 | n/a | if _arguments.get('errn', 0): |
|---|
| 420 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 421 | n/a | # XXXX Optionally decode result |
|---|
| 422 | n/a | if _arguments.has_key('----'): |
|---|
| 423 | n/a | return _arguments['----'] |
|---|
| 424 | n/a | |
|---|
| 425 | n/a | def select(self, _object, _attributes={}, **_arguments): |
|---|
| 426 | n/a | """select: Make a selection |
|---|
| 427 | n/a | Required argument: the object to select |
|---|
| 428 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 429 | n/a | """ |
|---|
| 430 | n/a | _code = 'misc' |
|---|
| 431 | n/a | _subcode = 'slct' |
|---|
| 432 | n/a | |
|---|
| 433 | n/a | if _arguments: raise TypeError, 'No optional args expected' |
|---|
| 434 | n/a | _arguments['----'] = _object |
|---|
| 435 | n/a | |
|---|
| 436 | n/a | |
|---|
| 437 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 438 | n/a | _arguments, _attributes) |
|---|
| 439 | n/a | if _arguments.get('errn', 0): |
|---|
| 440 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 441 | n/a | # XXXX Optionally decode result |
|---|
| 442 | n/a | if _arguments.has_key('----'): |
|---|
| 443 | n/a | return _arguments['----'] |
|---|
| 444 | n/a | |
|---|
| 445 | n/a | _argmap_suite_info = { |
|---|
| 446 | n/a | 'in_' : 'wrcd', |
|---|
| 447 | n/a | } |
|---|
| 448 | n/a | |
|---|
| 449 | n/a | def suite_info(self, _object, _attributes={}, **_arguments): |
|---|
| 450 | n/a | """suite info: (optional) Get information about event suite(s) |
|---|
| 451 | n/a | Required argument: the suite for which to return information |
|---|
| 452 | n/a | Keyword argument in_: the human language and script system in which to return information |
|---|
| 453 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 454 | n/a | Returns: a record containing the suites and their versions |
|---|
| 455 | n/a | """ |
|---|
| 456 | n/a | _code = 'core' |
|---|
| 457 | n/a | _subcode = 'gtsi' |
|---|
| 458 | n/a | |
|---|
| 459 | n/a | aetools.keysubst(_arguments, self._argmap_suite_info) |
|---|
| 460 | n/a | _arguments['----'] = _object |
|---|
| 461 | n/a | |
|---|
| 462 | n/a | |
|---|
| 463 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 464 | n/a | _arguments, _attributes) |
|---|
| 465 | n/a | if _arguments.get('errn', 0): |
|---|
| 466 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 467 | n/a | # XXXX Optionally decode result |
|---|
| 468 | n/a | if _arguments.has_key('----'): |
|---|
| 469 | n/a | return _arguments['----'] |
|---|
| 470 | n/a | |
|---|
| 471 | n/a | |
|---|
| 472 | n/a | class alias(aetools.ComponentItem): |
|---|
| 473 | n/a | """alias - a file on a disk or server. The file must exist when you check the syntax of your script. """ |
|---|
| 474 | n/a | want = 'alis' |
|---|
| 475 | n/a | class _Prop_POSIX_path(aetools.NProperty): |
|---|
| 476 | n/a | """POSIX path - the POSIX path of the file """ |
|---|
| 477 | n/a | which = 'psxp' |
|---|
| 478 | n/a | want = 'TEXT' |
|---|
| 479 | n/a | |
|---|
| 480 | n/a | aliases = alias |
|---|
| 481 | n/a | |
|---|
| 482 | n/a | class application(aetools.ComponentItem): |
|---|
| 483 | n/a | """application - An application program """ |
|---|
| 484 | n/a | want = 'capp' |
|---|
| 485 | n/a | class _Prop_clipboard(aetools.NProperty): |
|---|
| 486 | n/a | """clipboard - the contents of the clipboard for this application """ |
|---|
| 487 | n/a | which = 'pcli' |
|---|
| 488 | n/a | want = '****' |
|---|
| 489 | n/a | clipboard = _Prop_clipboard() |
|---|
| 490 | n/a | class _Prop_frontmost(aetools.NProperty): |
|---|
| 491 | n/a | """frontmost - Is this the frontmost application? """ |
|---|
| 492 | n/a | which = 'pisf' |
|---|
| 493 | n/a | want = 'bool' |
|---|
| 494 | n/a | frontmost = _Prop_frontmost() |
|---|
| 495 | n/a | class _Prop_name(aetools.NProperty): |
|---|
| 496 | n/a | """name - the name of the application """ |
|---|
| 497 | n/a | which = 'pnam' |
|---|
| 498 | n/a | want = 'itxt' |
|---|
| 499 | n/a | name = _Prop_name() |
|---|
| 500 | n/a | class _Prop_selection(aetools.NProperty): |
|---|
| 501 | n/a | """selection - the selection visible to the user. Use the \xd4select\xd5 command to set a new selection; use \xd4contents of selection\xd5 to get or change information in the document. """ |
|---|
| 502 | n/a | which = 'sele' |
|---|
| 503 | n/a | want = 'csel' |
|---|
| 504 | n/a | selection = _Prop_selection() |
|---|
| 505 | n/a | class _Prop_version(aetools.NProperty): |
|---|
| 506 | n/a | """version - the version of the application """ |
|---|
| 507 | n/a | which = 'vers' |
|---|
| 508 | n/a | want = 'vers' |
|---|
| 509 | n/a | version = _Prop_version() |
|---|
| 510 | n/a | |
|---|
| 511 | n/a | applications = application |
|---|
| 512 | n/a | |
|---|
| 513 | n/a | class insertion_points(aetools.ComponentItem): |
|---|
| 514 | n/a | """insertion points - """ |
|---|
| 515 | n/a | want = 'cins' |
|---|
| 516 | n/a | |
|---|
| 517 | n/a | insertion_point = insertion_points |
|---|
| 518 | n/a | |
|---|
| 519 | n/a | class selection_2d_object(aetools.ComponentItem): |
|---|
| 520 | n/a | """selection-object - A way to refer to the state of the current of the selection. Use the \xd4select\xd5 command to make a new selection. """ |
|---|
| 521 | n/a | want = 'csel' |
|---|
| 522 | n/a | class _Prop_contents(aetools.NProperty): |
|---|
| 523 | n/a | """contents - the information currently selected. Use \xd4contents of selection\xd5 to get or change information in a document. """ |
|---|
| 524 | n/a | which = 'pcnt' |
|---|
| 525 | n/a | want = '****' |
|---|
| 526 | n/a | |
|---|
| 527 | n/a | class window(aetools.ComponentItem): |
|---|
| 528 | n/a | """window - A window """ |
|---|
| 529 | n/a | want = 'cwin' |
|---|
| 530 | n/a | class _Prop_bounds(aetools.NProperty): |
|---|
| 531 | n/a | """bounds - the boundary rectangle for the window """ |
|---|
| 532 | n/a | which = 'pbnd' |
|---|
| 533 | n/a | want = 'qdrt' |
|---|
| 534 | n/a | class _Prop_closeable(aetools.NProperty): |
|---|
| 535 | n/a | """closeable - Does the window have a close box? """ |
|---|
| 536 | n/a | which = 'hclb' |
|---|
| 537 | n/a | want = 'bool' |
|---|
| 538 | n/a | class _Prop_floating(aetools.NProperty): |
|---|
| 539 | n/a | """floating - Does the window float? """ |
|---|
| 540 | n/a | which = 'isfl' |
|---|
| 541 | n/a | want = 'bool' |
|---|
| 542 | n/a | class _Prop_index(aetools.NProperty): |
|---|
| 543 | n/a | """index - the number of the window """ |
|---|
| 544 | n/a | which = 'pidx' |
|---|
| 545 | n/a | want = 'long' |
|---|
| 546 | n/a | class _Prop_modal(aetools.NProperty): |
|---|
| 547 | n/a | """modal - Is the window modal? """ |
|---|
| 548 | n/a | which = 'pmod' |
|---|
| 549 | n/a | want = 'bool' |
|---|
| 550 | n/a | class _Prop_resizable(aetools.NProperty): |
|---|
| 551 | n/a | """resizable - Is the window resizable? """ |
|---|
| 552 | n/a | which = 'prsz' |
|---|
| 553 | n/a | want = 'bool' |
|---|
| 554 | n/a | class _Prop_titled(aetools.NProperty): |
|---|
| 555 | n/a | """titled - Does the window have a title bar? """ |
|---|
| 556 | n/a | which = 'ptit' |
|---|
| 557 | n/a | want = 'bool' |
|---|
| 558 | n/a | class _Prop_visible(aetools.NProperty): |
|---|
| 559 | n/a | """visible - Is the window visible? """ |
|---|
| 560 | n/a | which = 'pvis' |
|---|
| 561 | n/a | want = 'bool' |
|---|
| 562 | n/a | class _Prop_zoomable(aetools.NProperty): |
|---|
| 563 | n/a | """zoomable - Is the window zoomable? """ |
|---|
| 564 | n/a | which = 'iszm' |
|---|
| 565 | n/a | want = 'bool' |
|---|
| 566 | n/a | class _Prop_zoomed(aetools.NProperty): |
|---|
| 567 | n/a | """zoomed - Is the window zoomed? """ |
|---|
| 568 | n/a | which = 'pzum' |
|---|
| 569 | n/a | want = 'bool' |
|---|
| 570 | n/a | |
|---|
| 571 | n/a | windows = window |
|---|
| 572 | n/a | |
|---|
| 573 | n/a | class document(aetools.ComponentItem): |
|---|
| 574 | n/a | """document - A document of a scriptable application """ |
|---|
| 575 | n/a | want = 'docu' |
|---|
| 576 | n/a | class _Prop_modified(aetools.NProperty): |
|---|
| 577 | n/a | """modified - Has the document been modified since the last save? """ |
|---|
| 578 | n/a | which = 'imod' |
|---|
| 579 | n/a | want = 'bool' |
|---|
| 580 | n/a | |
|---|
| 581 | n/a | documents = document |
|---|
| 582 | n/a | |
|---|
| 583 | n/a | class file(aetools.ComponentItem): |
|---|
| 584 | n/a | """file - a file on a disk or server """ |
|---|
| 585 | n/a | want = 'file' |
|---|
| 586 | n/a | |
|---|
| 587 | n/a | files = file |
|---|
| 588 | n/a | alias._superclassnames = [] |
|---|
| 589 | n/a | alias._privpropdict = { |
|---|
| 590 | n/a | 'POSIX_path' : _Prop_POSIX_path, |
|---|
| 591 | n/a | } |
|---|
| 592 | n/a | alias._privelemdict = { |
|---|
| 593 | n/a | } |
|---|
| 594 | n/a | application._superclassnames = [] |
|---|
| 595 | n/a | application._privpropdict = { |
|---|
| 596 | n/a | 'clipboard' : _Prop_clipboard, |
|---|
| 597 | n/a | 'frontmost' : _Prop_frontmost, |
|---|
| 598 | n/a | 'name' : _Prop_name, |
|---|
| 599 | n/a | 'selection' : _Prop_selection, |
|---|
| 600 | n/a | 'version' : _Prop_version, |
|---|
| 601 | n/a | } |
|---|
| 602 | n/a | application._privelemdict = { |
|---|
| 603 | n/a | } |
|---|
| 604 | n/a | insertion_points._superclassnames = [] |
|---|
| 605 | n/a | insertion_points._privpropdict = { |
|---|
| 606 | n/a | } |
|---|
| 607 | n/a | insertion_points._privelemdict = { |
|---|
| 608 | n/a | } |
|---|
| 609 | n/a | selection_2d_object._superclassnames = [] |
|---|
| 610 | n/a | selection_2d_object._privpropdict = { |
|---|
| 611 | n/a | 'contents' : _Prop_contents, |
|---|
| 612 | n/a | } |
|---|
| 613 | n/a | selection_2d_object._privelemdict = { |
|---|
| 614 | n/a | } |
|---|
| 615 | n/a | window._superclassnames = [] |
|---|
| 616 | n/a | window._privpropdict = { |
|---|
| 617 | n/a | 'bounds' : _Prop_bounds, |
|---|
| 618 | n/a | 'closeable' : _Prop_closeable, |
|---|
| 619 | n/a | 'floating' : _Prop_floating, |
|---|
| 620 | n/a | 'index' : _Prop_index, |
|---|
| 621 | n/a | 'modal' : _Prop_modal, |
|---|
| 622 | n/a | 'resizable' : _Prop_resizable, |
|---|
| 623 | n/a | 'titled' : _Prop_titled, |
|---|
| 624 | n/a | 'visible' : _Prop_visible, |
|---|
| 625 | n/a | 'zoomable' : _Prop_zoomable, |
|---|
| 626 | n/a | 'zoomed' : _Prop_zoomed, |
|---|
| 627 | n/a | } |
|---|
| 628 | n/a | window._privelemdict = { |
|---|
| 629 | n/a | } |
|---|
| 630 | n/a | document._superclassnames = [] |
|---|
| 631 | n/a | document._privpropdict = { |
|---|
| 632 | n/a | 'modified' : _Prop_modified, |
|---|
| 633 | n/a | } |
|---|
| 634 | n/a | document._privelemdict = { |
|---|
| 635 | n/a | } |
|---|
| 636 | n/a | file._superclassnames = [] |
|---|
| 637 | n/a | file._privpropdict = { |
|---|
| 638 | n/a | 'POSIX_path' : _Prop_POSIX_path, |
|---|
| 639 | n/a | } |
|---|
| 640 | n/a | file._privelemdict = { |
|---|
| 641 | n/a | } |
|---|
| 642 | n/a | class _3c_(aetools.NComparison): |
|---|
| 643 | n/a | """< - Less than """ |
|---|
| 644 | n/a | class _3d_(aetools.NComparison): |
|---|
| 645 | n/a | """= - Equal """ |
|---|
| 646 | n/a | class _3e_(aetools.NComparison): |
|---|
| 647 | n/a | """> - Greater than """ |
|---|
| 648 | n/a | class contains(aetools.NComparison): |
|---|
| 649 | n/a | """contains - Contains """ |
|---|
| 650 | n/a | class ends_with(aetools.NComparison): |
|---|
| 651 | n/a | """ends with - Ends with """ |
|---|
| 652 | n/a | class starts_with(aetools.NComparison): |
|---|
| 653 | n/a | """starts with - Starts with """ |
|---|
| 654 | n/a | class _b2_(aetools.NComparison): |
|---|
| 655 | n/a | """\xb2 - Less than or equal to """ |
|---|
| 656 | n/a | class _b3_(aetools.NComparison): |
|---|
| 657 | n/a | """\xb3 - Greater than or equal to """ |
|---|
| 658 | n/a | _Enum_kfrm = { |
|---|
| 659 | n/a | 'index' : 'indx', # keyform designating indexed access |
|---|
| 660 | n/a | 'named' : 'name', # keyform designating named access |
|---|
| 661 | n/a | 'id' : 'ID ', # keyform designating access by unique identifier |
|---|
| 662 | n/a | } |
|---|
| 663 | n/a | |
|---|
| 664 | n/a | _Enum_savo = { |
|---|
| 665 | n/a | 'yes' : 'yes ', # Save objects now |
|---|
| 666 | n/a | 'no' : 'no ', # Do not save objects |
|---|
| 667 | n/a | 'ask' : 'ask ', # Ask the user whether to save |
|---|
| 668 | n/a | } |
|---|
| 669 | n/a | |
|---|
| 670 | n/a | _Enum_styl = { |
|---|
| 671 | n/a | 'plain' : 'plan', # Plain |
|---|
| 672 | n/a | 'bold' : 'bold', # Bold |
|---|
| 673 | n/a | 'italic' : 'ital', # Italic |
|---|
| 674 | n/a | 'outline' : 'outl', # Outline |
|---|
| 675 | n/a | 'shadow' : 'shad', # Shadow |
|---|
| 676 | n/a | 'underline' : 'undl', # Underline |
|---|
| 677 | n/a | 'superscript' : 'spsc', # Superscript |
|---|
| 678 | n/a | 'subscript' : 'sbsc', # Subscript |
|---|
| 679 | n/a | 'strikethrough' : 'strk', # Strikethrough |
|---|
| 680 | n/a | 'small_caps' : 'smcp', # Small caps |
|---|
| 681 | n/a | 'all_caps' : 'alcp', # All capital letters |
|---|
| 682 | n/a | 'all_lowercase' : 'lowc', # Lowercase |
|---|
| 683 | n/a | 'condensed' : 'cond', # Condensed |
|---|
| 684 | n/a | 'expanded' : 'pexp', # Expanded |
|---|
| 685 | n/a | 'hidden' : 'hidn', # Hidden |
|---|
| 686 | n/a | } |
|---|
| 687 | n/a | |
|---|
| 688 | n/a | |
|---|
| 689 | n/a | # |
|---|
| 690 | n/a | # Indices of types declared in this module |
|---|
| 691 | n/a | # |
|---|
| 692 | n/a | _classdeclarations = { |
|---|
| 693 | n/a | 'alis' : alias, |
|---|
| 694 | n/a | 'capp' : application, |
|---|
| 695 | n/a | 'cins' : insertion_points, |
|---|
| 696 | n/a | 'csel' : selection_2d_object, |
|---|
| 697 | n/a | 'cwin' : window, |
|---|
| 698 | n/a | 'docu' : document, |
|---|
| 699 | n/a | 'file' : file, |
|---|
| 700 | n/a | } |
|---|
| 701 | n/a | |
|---|
| 702 | n/a | _propdeclarations = { |
|---|
| 703 | n/a | 'hclb' : _Prop_closeable, |
|---|
| 704 | n/a | 'imod' : _Prop_modified, |
|---|
| 705 | n/a | 'isfl' : _Prop_floating, |
|---|
| 706 | n/a | 'iszm' : _Prop_zoomable, |
|---|
| 707 | n/a | 'pbnd' : _Prop_bounds, |
|---|
| 708 | n/a | 'pcli' : _Prop_clipboard, |
|---|
| 709 | n/a | 'pcnt' : _Prop_contents, |
|---|
| 710 | n/a | 'pidx' : _Prop_index, |
|---|
| 711 | n/a | 'pisf' : _Prop_frontmost, |
|---|
| 712 | n/a | 'pmod' : _Prop_modal, |
|---|
| 713 | n/a | 'pnam' : _Prop_name, |
|---|
| 714 | n/a | 'prsz' : _Prop_resizable, |
|---|
| 715 | n/a | 'psxp' : _Prop_POSIX_path, |
|---|
| 716 | n/a | 'ptit' : _Prop_titled, |
|---|
| 717 | n/a | 'pvis' : _Prop_visible, |
|---|
| 718 | n/a | 'pzum' : _Prop_zoomed, |
|---|
| 719 | n/a | 'sele' : _Prop_selection, |
|---|
| 720 | n/a | 'vers' : _Prop_version, |
|---|
| 721 | n/a | } |
|---|
| 722 | n/a | |
|---|
| 723 | n/a | _compdeclarations = { |
|---|
| 724 | n/a | '< ' : _3c_, |
|---|
| 725 | n/a | '<= ' : _b2_, |
|---|
| 726 | n/a | '= ' : _3d_, |
|---|
| 727 | n/a | '> ' : _3e_, |
|---|
| 728 | n/a | '>= ' : _b3_, |
|---|
| 729 | n/a | 'bgwt' : starts_with, |
|---|
| 730 | n/a | 'cont' : contains, |
|---|
| 731 | n/a | 'ends' : ends_with, |
|---|
| 732 | n/a | } |
|---|
| 733 | n/a | |
|---|
| 734 | n/a | _enumdeclarations = { |
|---|
| 735 | n/a | 'kfrm' : _Enum_kfrm, |
|---|
| 736 | n/a | 'savo' : _Enum_savo, |
|---|
| 737 | n/a | 'styl' : _Enum_styl, |
|---|
| 738 | n/a | } |
|---|