| 1 |
"""Suite Standard Suite: Common terms for most applications |
| 2 |
Level 1, version 1 |
| 3 |
|
| 4 |
Generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5 |
| 5 |
AETE/AEUT resource version 1/0, language 0, script 0 |
| 6 |
""" |
| 7 |
|
| 8 |
import aetools |
| 9 |
import MacOS |
| 10 |
|
| 11 |
_code = 'CoRe' |
| 12 |
|
| 13 |
from StdSuites.Standard_Suite import * |
| 14 |
class Standard_Suite_Events(Standard_Suite_Events): |
| 15 |
|
| 16 |
_argmap_close = { |
| 17 |
'saving' : 'savo', |
| 18 |
'saving_in' : 'kfil', |
| 19 |
} |
| 20 |
|
| 21 |
def close(self, _object, _attributes={}, **_arguments): |
| 22 |
"""close: close an object |
| 23 |
Required argument: the object to close |
| 24 |
Keyword argument saving: specifies whether or not changes should be saved before closing |
| 25 |
Keyword argument saving_in: the file in which to save the object |
| 26 |
Keyword argument _attributes: AppleEvent attribute dictionary |
| 27 |
""" |
| 28 |
_code = 'core' |
| 29 |
_subcode = 'clos' |
| 30 |
|
| 31 |
aetools.keysubst(_arguments, self._argmap_close) |
| 32 |
_arguments['----'] = _object |
| 33 |
|
| 34 |
aetools.enumsubst(_arguments, 'savo', _Enum_savo) |
| 35 |
|
| 36 |
_reply, _arguments, _attributes = self.send(_code, _subcode, |
| 37 |
_arguments, _attributes) |
| 38 |
if _arguments.get('errn', 0): |
| 39 |
raise aetools.Error, aetools.decodeerror(_arguments) |
| 40 |
|
| 41 |
if _arguments.has_key('----'): |
| 42 |
return _arguments['----'] |
| 43 |
|
| 44 |
_argmap_count = { |
| 45 |
'each' : 'kocl', |
| 46 |
} |
| 47 |
|
| 48 |
def count(self, _object, _attributes={}, **_arguments): |
| 49 |
"""count: return the number of elements of a particular class within an object |
| 50 |
Required argument: the object whose elements are to be counted |
| 51 |
Keyword argument each: the class of the elements to be counted. Keyword 'each' is optional in AppleScript |
| 52 |
Keyword argument _attributes: AppleEvent attribute dictionary |
| 53 |
Returns: the number of elements |
| 54 |
""" |
| 55 |
_code = 'core' |
| 56 |
_subcode = 'cnte' |
| 57 |
|
| 58 |
aetools.keysubst(_arguments, self._argmap_count) |
| 59 |
_arguments['----'] = _object |
| 60 |
|
| 61 |
|
| 62 |
_reply, _arguments, _attributes = self.send(_code, _subcode, |
| 63 |
_arguments, _attributes) |
| 64 |
if _arguments.get('errn', 0): |
| 65 |
raise aetools.Error, aetools.decodeerror(_arguments) |
| 66 |
|
| 67 |
if _arguments.has_key('----'): |
| 68 |
return _arguments['----'] |
| 69 |
|
| 70 |
_argmap_get = { |
| 71 |
'as' : 'rtyp', |
| 72 |
} |
| 73 |
|
| 74 |
def get(self, _object, _attributes={}, **_arguments): |
| 75 |
"""get: get the data for an object |
| 76 |
Required argument: the object whose data is to be returned |
| 77 |
Keyword argument as: the desired types for the data, in order of preference |
| 78 |
Keyword argument _attributes: AppleEvent attribute dictionary |
| 79 |
Returns: The data from the object |
| 80 |
""" |
| 81 |
_code = 'core' |
| 82 |
_subcode = 'getd' |
| 83 |
|
| 84 |
aetools.keysubst(_arguments, self._argmap_get) |
| 85 |
_arguments['----'] = _object |
| 86 |
|
| 87 |
|
| 88 |
_reply, _arguments, _attributes = self.send(_code, _subcode, |
| 89 |
_arguments, _attributes) |
| 90 |
if _arguments.get('errn', 0): |
| 91 |
raise aetools.Error, aetools.decodeerror(_arguments) |
| 92 |
|
| 93 |
if _arguments.has_key('----'): |
| 94 |
return _arguments['----'] |
| 95 |
|
| 96 |
_argmap_make = { |
| 97 |
'new' : 'kocl', |
| 98 |
'as' : 'rtyp', |
| 99 |
'at' : 'insh', |
| 100 |
'with_data' : 'data', |
| 101 |
'with_properties' : 'prdt', |
| 102 |
} |
| 103 |
|
| 104 |
def make(self, _no_object=None, _attributes={}, **_arguments): |
| 105 |
"""make: make a new element |
| 106 |
Keyword argument new: the class of the new element\xd1keyword 'new' is optional in AppleScript |
| 107 |
Keyword argument as: the desired types for the data, in order of preference |
| 108 |
Keyword argument at: the location at which to insert the element |
| 109 |
Keyword argument with_data: the initial data for the element |
| 110 |
Keyword argument with_properties: the initial values for the properties of the element |
| 111 |
Keyword argument _attributes: AppleEvent attribute dictionary |
| 112 |
Returns: to the new object(s) |
| 113 |
""" |
| 114 |
_code = 'core' |
| 115 |
_subcode = 'crel' |
| 116 |
|
| 117 |
aetools.keysubst(_arguments, self._argmap_make) |
| 118 |
if _no_object is not None: raise TypeError, 'No direct arg expected' |
| 119 |
|
| 120 |
|
| 121 |
_reply, _arguments, _attributes = self.send(_code, _subcode, |
| 122 |
_arguments, _attributes) |
| 123 |
if _arguments.get('errn', 0): |
| 124 |
raise aetools.Error, aetools.decodeerror(_arguments) |
| 125 |
|
| 126 |
if _arguments.has_key('----'): |
| 127 |
return _arguments['----'] |
| 128 |
|
| 129 |
def select(self, _object=None, _attributes={}, **_arguments): |
| 130 |
"""select: select the specified object |
| 131 |
Required argument: the object to select |
| 132 |
Keyword argument _attributes: AppleEvent attribute dictionary |
| 133 |
""" |
| 134 |
_code = 'misc' |
| 135 |
_subcode = 'slct' |
| 136 |
|
| 137 |
if _arguments: raise TypeError, 'No optional args expected' |
| 138 |
_arguments['----'] = _object |
| 139 |
|
| 140 |
|
| 141 |
_reply, _arguments, _attributes = self.send(_code, _subcode, |
| 142 |
_arguments, _attributes) |
| 143 |
if _arguments.get('errn', 0): |
| 144 |
raise aetools.Error, aetools.decodeerror(_arguments) |
| 145 |
|
| 146 |
if _arguments.has_key('----'): |
| 147 |
return _arguments['----'] |
| 148 |
|
| 149 |
_argmap_set = { |
| 150 |
'to' : 'data', |
| 151 |
} |
| 152 |
|
| 153 |
def set(self, _object, _attributes={}, **_arguments): |
| 154 |
"""set: set an object's data |
| 155 |
Required argument: the object to change |
| 156 |
Keyword argument to: the new value |
| 157 |
Keyword argument _attributes: AppleEvent attribute dictionary |
| 158 |
""" |
| 159 |
_code = 'core' |
| 160 |
_subcode = 'setd' |
| 161 |
|
| 162 |
aetools.keysubst(_arguments, self._argmap_set) |
| 163 |
_arguments['----'] = _object |
| 164 |
|
| 165 |
|
| 166 |
_reply, _arguments, _attributes = self.send(_code, _subcode, |
| 167 |
_arguments, _attributes) |
| 168 |
if _arguments.get('errn', 0): |
| 169 |
raise aetools.Error, aetools.decodeerror(_arguments) |
| 170 |
|
| 171 |
if _arguments.has_key('----'): |
| 172 |
return _arguments['----'] |
| 173 |
|
| 174 |
|
| 175 |
class application(aetools.ComponentItem): |
| 176 |
"""application - an application program """ |
| 177 |
want = 'capp' |
| 178 |
class _Prop_user_interaction(aetools.NProperty): |
| 179 |
"""user interaction - user interaction level """ |
| 180 |
which = 'inte' |
| 181 |
want = 'Inte' |
| 182 |
user_interaction = _Prop_user_interaction() |
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
class character(aetools.ComponentItem): |
| 187 |
"""character - a character """ |
| 188 |
want = 'cha ' |
| 189 |
class _Prop_length(aetools.NProperty): |
| 190 |
"""length - length in characters of this object """ |
| 191 |
which = 'pLen' |
| 192 |
want = 'long' |
| 193 |
class _Prop_offset(aetools.NProperty): |
| 194 |
"""offset - offset of a text object from the beginning of the document (first char has offset 1) """ |
| 195 |
which = 'pOff' |
| 196 |
want = 'long' |
| 197 |
|
| 198 |
class insertion_point(aetools.ComponentItem): |
| 199 |
"""insertion point - An insertion location between two objects """ |
| 200 |
want = 'cins' |
| 201 |
|
| 202 |
class line(aetools.ComponentItem): |
| 203 |
"""line - lines of text """ |
| 204 |
want = 'clin' |
| 205 |
class _Prop_index(aetools.NProperty): |
| 206 |
"""index - index of a line object from the beginning of the document (first line has index 1) """ |
| 207 |
which = 'pidx' |
| 208 |
want = 'long' |
| 209 |
|
| 210 |
|
| 211 |
lines = line |
| 212 |
|
| 213 |
class selection_2d_object(aetools.ComponentItem): |
| 214 |
"""selection-object - the selection visible to the user """ |
| 215 |
want = 'csel' |
| 216 |
class _Prop_contents(aetools.NProperty): |
| 217 |
"""contents - the contents of the selection """ |
| 218 |
which = 'pcnt' |
| 219 |
want = 'type' |
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
class text(aetools.ComponentItem): |
| 225 |
"""text - Text """ |
| 226 |
want = 'ctxt' |
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
class window(aetools.ComponentItem): |
| 233 |
"""window - A window """ |
| 234 |
want = 'cwin' |
| 235 |
class _Prop_bounds(aetools.NProperty): |
| 236 |
"""bounds - the boundary rectangle for the window """ |
| 237 |
which = 'pbnd' |
| 238 |
want = 'qdrt' |
| 239 |
class _Prop_document(aetools.NProperty): |
| 240 |
"""document - the document that owns this window """ |
| 241 |
which = 'docu' |
| 242 |
want = 'docu' |
| 243 |
class _Prop_name(aetools.NProperty): |
| 244 |
"""name - the title of the window """ |
| 245 |
which = 'pnam' |
| 246 |
want = 'itxt' |
| 247 |
class _Prop_position(aetools.NProperty): |
| 248 |
"""position - upper left coordinates of window """ |
| 249 |
which = 'ppos' |
| 250 |
want = 'QDpt' |
| 251 |
class _Prop_visible(aetools.NProperty): |
| 252 |
"""visible - is the window visible? """ |
| 253 |
which = 'pvis' |
| 254 |
want = 'bool' |
| 255 |
class _Prop_zoomed(aetools.NProperty): |
| 256 |
"""zoomed - Is the window zoomed? """ |
| 257 |
which = 'pzum' |
| 258 |
want = 'bool' |
| 259 |
|
| 260 |
windows = window |
| 261 |
|
| 262 |
class document(aetools.ComponentItem): |
| 263 |
"""document - a document """ |
| 264 |
want = 'docu' |
| 265 |
class _Prop_file_permissions(aetools.NProperty): |
| 266 |
"""file permissions - the file permissions for the document """ |
| 267 |
which = 'PERM' |
| 268 |
want = 'PERM' |
| 269 |
class _Prop_kind(aetools.NProperty): |
| 270 |
"""kind - the kind of document """ |
| 271 |
which = 'DKND' |
| 272 |
want = 'DKND' |
| 273 |
class _Prop_location(aetools.NProperty): |
| 274 |
"""location - the file of the document """ |
| 275 |
which = 'FILE' |
| 276 |
want = 'fss ' |
| 277 |
class _Prop_window(aetools.NProperty): |
| 278 |
"""window - the window of the document. """ |
| 279 |
which = 'cwin' |
| 280 |
want = 'cwin' |
| 281 |
|
| 282 |
documents = document |
| 283 |
|
| 284 |
class files(aetools.ComponentItem): |
| 285 |
"""files - Every file """ |
| 286 |
want = 'file' |
| 287 |
|
| 288 |
file = files |
| 289 |
application._superclassnames = [] |
| 290 |
application._privpropdict = { |
| 291 |
'user_interaction' : _Prop_user_interaction, |
| 292 |
} |
| 293 |
application._privelemdict = { |
| 294 |
'document' : document, |
| 295 |
'window' : window, |
| 296 |
} |
| 297 |
character._superclassnames = [] |
| 298 |
character._privpropdict = { |
| 299 |
'length' : _Prop_length, |
| 300 |
'offset' : _Prop_offset, |
| 301 |
} |
| 302 |
character._privelemdict = { |
| 303 |
} |
| 304 |
insertion_point._superclassnames = [] |
| 305 |
insertion_point._privpropdict = { |
| 306 |
'length' : _Prop_length, |
| 307 |
'offset' : _Prop_offset, |
| 308 |
} |
| 309 |
insertion_point._privelemdict = { |
| 310 |
} |
| 311 |
line._superclassnames = [] |
| 312 |
line._privpropdict = { |
| 313 |
'index' : _Prop_index, |
| 314 |
'length' : _Prop_length, |
| 315 |
'offset' : _Prop_offset, |
| 316 |
} |
| 317 |
line._privelemdict = { |
| 318 |
'character' : character, |
| 319 |
} |
| 320 |
selection_2d_object._superclassnames = [] |
| 321 |
selection_2d_object._privpropdict = { |
| 322 |
'contents' : _Prop_contents, |
| 323 |
'length' : _Prop_length, |
| 324 |
'offset' : _Prop_offset, |
| 325 |
} |
| 326 |
selection_2d_object._privelemdict = { |
| 327 |
'character' : character, |
| 328 |
'line' : line, |
| 329 |
'text' : text, |
| 330 |
} |
| 331 |
text._superclassnames = [] |
| 332 |
text._privpropdict = { |
| 333 |
'length' : _Prop_length, |
| 334 |
'offset' : _Prop_offset, |
| 335 |
} |
| 336 |
text._privelemdict = { |
| 337 |
'character' : character, |
| 338 |
'insertion_point' : insertion_point, |
| 339 |
'line' : line, |
| 340 |
'text' : text, |
| 341 |
} |
| 342 |
window._superclassnames = [] |
| 343 |
window._privpropdict = { |
| 344 |
'bounds' : _Prop_bounds, |
| 345 |
'document' : _Prop_document, |
| 346 |
'index' : _Prop_index, |
| 347 |
'name' : _Prop_name, |
| 348 |
'position' : _Prop_position, |
| 349 |
'visible' : _Prop_visible, |
| 350 |
'zoomed' : _Prop_zoomed, |
| 351 |
} |
| 352 |
window._privelemdict = { |
| 353 |
} |
| 354 |
document._superclassnames = [] |
| 355 |
document._privpropdict = { |
| 356 |
'file_permissions' : _Prop_file_permissions, |
| 357 |
'index' : _Prop_index, |
| 358 |
'kind' : _Prop_kind, |
| 359 |
'location' : _Prop_location, |
| 360 |
'name' : _Prop_name, |
| 361 |
'window' : _Prop_window, |
| 362 |
} |
| 363 |
document._privelemdict = { |
| 364 |
} |
| 365 |
files._superclassnames = [] |
| 366 |
files._privpropdict = { |
| 367 |
} |
| 368 |
files._privelemdict = { |
| 369 |
} |
| 370 |
|
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
_classdeclarations = { |
| 375 |
'capp' : application, |
| 376 |
'cha ' : character, |
| 377 |
'cins' : insertion_point, |
| 378 |
'clin' : line, |
| 379 |
'csel' : selection_2d_object, |
| 380 |
'ctxt' : text, |
| 381 |
'cwin' : window, |
| 382 |
'docu' : document, |
| 383 |
'file' : files, |
| 384 |
} |
| 385 |
|
| 386 |
_propdeclarations = { |
| 387 |
'DKND' : _Prop_kind, |
| 388 |
'FILE' : _Prop_location, |
| 389 |
'PERM' : _Prop_file_permissions, |
| 390 |
'cwin' : _Prop_window, |
| 391 |
'docu' : _Prop_document, |
| 392 |
'inte' : _Prop_user_interaction, |
| 393 |
'pLen' : _Prop_length, |
| 394 |
'pOff' : _Prop_offset, |
| 395 |
'pbnd' : _Prop_bounds, |
| 396 |
'pcnt' : _Prop_contents, |
| 397 |
'pidx' : _Prop_index, |
| 398 |
'pnam' : _Prop_name, |
| 399 |
'ppos' : _Prop_position, |
| 400 |
'pvis' : _Prop_visible, |
| 401 |
'pzum' : _Prop_zoomed, |
| 402 |
} |
| 403 |
|
| 404 |
_compdeclarations = { |
| 405 |
} |
| 406 |
|
| 407 |
_enumdeclarations = { |
| 408 |
} |