Ditched '_find_SET()', since it was a no-value-added wrapper around
[python/dscho.git] / Mac / Lib / lib-scripting / AppleScript_Suite.py
blobea9f1f1e80a310a0729d094191d48c469beb1a98
1 """Suite AppleScript Suite: Goodies for Gustav
2 Level 1, version 1
4 Generated from flap:System Folder:Extensions:Scripting Additions:Dialects:English Dialect
5 AETE/AEUT resource version 1/0, language 0, script 0
6 """
8 import aetools
9 import MacOS
11 _code = 'ascr'
13 class AppleScript_Suite:
15 def activate(self, _no_object=None, _attributes={}, **_arguments):
16 """activate: Bring targeted application program to the front.
17 Keyword argument _attributes: AppleEvent attribute dictionary
18 """
19 _code = 'misc'
20 _subcode = 'actv'
22 if _arguments: raise TypeError, 'No optional args expected'
23 if _no_object != None: raise TypeError, 'No direct arg expected'
26 _reply, _arguments, _attributes = self.send(_code, _subcode,
27 _arguments, _attributes)
28 if _arguments.has_key('errn'):
29 raise aetools.Error, aetools.decodeerror(_arguments)
30 # XXXX Optionally decode result
31 if _arguments.has_key('----'):
32 return _arguments['----']
34 def log(self, _object, _attributes={}, **_arguments):
35 """log: Cause a comment to be logged.
36 Required argument: anything
37 Keyword argument _attributes: AppleEvent attribute dictionary
38 """
39 _code = 'ascr'
40 _subcode = 'cmnt'
42 if _arguments: raise TypeError, 'No optional args expected'
43 _arguments['----'] = _object
46 _reply, _arguments, _attributes = self.send(_code, _subcode,
47 _arguments, _attributes)
48 if _arguments.has_key('errn'):
49 raise aetools.Error, aetools.decodeerror(_arguments)
50 # XXXX Optionally decode result
51 if _arguments.has_key('----'):
52 return _arguments['----']
54 def stop_log(self, _no_object=None, _attributes={}, **_arguments):
55 """stop log:
56 Keyword argument _attributes: AppleEvent attribute dictionary
57 """
58 _code = 'ToyS'
59 _subcode = 'log0'
61 if _arguments: raise TypeError, 'No optional args expected'
62 if _no_object != None: raise TypeError, 'No direct arg expected'
65 _reply, _arguments, _attributes = self.send(_code, _subcode,
66 _arguments, _attributes)
67 if _arguments.has_key('errn'):
68 raise aetools.Error, aetools.decodeerror(_arguments)
69 # XXXX Optionally decode result
70 if _arguments.has_key('----'):
71 return _arguments['----']
73 def start_log(self, _no_object=None, _attributes={}, **_arguments):
74 """start log:
75 Keyword argument _attributes: AppleEvent attribute dictionary
76 """
77 _code = 'ToyS'
78 _subcode = 'log1'
80 if _arguments: raise TypeError, 'No optional args expected'
81 if _no_object != None: raise TypeError, 'No direct arg expected'
84 _reply, _arguments, _attributes = self.send(_code, _subcode,
85 _arguments, _attributes)
86 if _arguments.has_key('errn'):
87 raise aetools.Error, aetools.decodeerror(_arguments)
88 # XXXX Optionally decode result
89 if _arguments.has_key('----'):
90 return _arguments['----']
92 def copy(self, _no_object=None, _attributes={}, **_arguments):
93 """copy: Copy an object to the clipboard
94 Keyword argument _attributes: AppleEvent attribute dictionary
95 """
96 _code = 'misc'
97 _subcode = 'copy'
99 if _arguments: raise TypeError, 'No optional args expected'
100 if _no_object != None: raise TypeError, 'No direct arg expected'
103 _reply, _arguments, _attributes = self.send(_code, _subcode,
104 _arguments, _attributes)
105 if _arguments.has_key('errn'):
106 raise aetools.Error, aetools.decodeerror(_arguments)
107 # XXXX Optionally decode result
108 if _arguments.has_key('----'):
109 return _arguments['----']
111 def do_script(self, _object, _attributes={}, **_arguments):
112 """do script: Execute a script
113 Required argument: the script to execute
114 Keyword argument _attributes: AppleEvent attribute dictionary
115 Returns: anything
117 _code = 'misc'
118 _subcode = 'dosc'
120 if _arguments: raise TypeError, 'No optional args expected'
121 _arguments['----'] = _object
124 _reply, _arguments, _attributes = self.send(_code, _subcode,
125 _arguments, _attributes)
126 if _arguments.has_key('errn'):
127 raise aetools.Error, aetools.decodeerror(_arguments)
128 # XXXX Optionally decode result
129 if _arguments.has_key('----'):
130 return _arguments['----']
132 def idle(self, _no_object=None, _attributes={}, **_arguments):
133 """idle: Sent to a script application when it is idle
134 Keyword argument _attributes: AppleEvent attribute dictionary
135 Returns: Number of seconds to wait for next idle event
137 _code = 'misc'
138 _subcode = 'idle'
140 if _arguments: raise TypeError, 'No optional args expected'
141 if _no_object != None: raise TypeError, 'No direct arg expected'
144 _reply, _arguments, _attributes = self.send(_code, _subcode,
145 _arguments, _attributes)
146 if _arguments.has_key('errn'):
147 raise aetools.Error, aetools.decodeerror(_arguments)
148 # XXXX Optionally decode result
149 if _arguments.has_key('----'):
150 return _arguments['----']
152 def launch(self, _no_object=None, _attributes={}, **_arguments):
153 """launch: Start an application for scripting
154 Keyword argument _attributes: AppleEvent attribute dictionary
155 Returns: anything
157 _code = 'ascr'
158 _subcode = 'noop'
160 if _arguments: raise TypeError, 'No optional args expected'
161 if _no_object != None: raise TypeError, 'No direct arg expected'
164 _reply, _arguments, _attributes = self.send(_code, _subcode,
165 _arguments, _attributes)
166 if _arguments.has_key('errn'):
167 raise aetools.Error, aetools.decodeerror(_arguments)
168 # XXXX Optionally decode result
169 if _arguments.has_key('----'):
170 return _arguments['----']
172 def tell(self, _no_object=None, _attributes={}, **_arguments):
173 """tell: Magic tell event for event logging
174 Keyword argument _attributes: AppleEvent attribute dictionary
175 Returns: anything
177 _code = 'ascr'
178 _subcode = 'tell'
180 if _arguments: raise TypeError, 'No optional args expected'
181 if _no_object != None: raise TypeError, 'No direct arg expected'
184 _reply, _arguments, _attributes = self.send(_code, _subcode,
185 _arguments, _attributes)
186 if _arguments.has_key('errn'):
187 raise aetools.Error, aetools.decodeerror(_arguments)
188 # XXXX Optionally decode result
189 if _arguments.has_key('----'):
190 return _arguments['----']
192 def end_tell(self, _no_object=None, _attributes={}, **_arguments):
193 """end tell: Start an application for scripting
194 Keyword argument _attributes: AppleEvent attribute dictionary
195 Returns: anything
197 _code = 'ascr'
198 _subcode = 'tend'
200 if _arguments: raise TypeError, 'No optional args expected'
201 if _no_object != None: raise TypeError, 'No direct arg expected'
204 _reply, _arguments, _attributes = self.send(_code, _subcode,
205 _arguments, _attributes)
206 if _arguments.has_key('errn'):
207 raise aetools.Error, aetools.decodeerror(_arguments)
208 # XXXX Optionally decode result
209 if _arguments.has_key('----'):
210 return _arguments['----']
212 _argmap_error = {
213 'number' : 'errn',
214 'partial_result' : 'ptlr',
215 '_from' : 'erob',
216 'to' : 'errt',
219 def error(self, _object=None, _attributes={}, **_arguments):
220 """error: Raise an error
221 Required argument: anything
222 Keyword argument number: an error number
223 Keyword argument partial_result: any partial result occurring before the error
224 Keyword argument _from: the object that caused the error
225 Keyword argument to: another parameter to the error
226 Keyword argument _attributes: AppleEvent attribute dictionary
227 Returns: anything
229 _code = 'ascr'
230 _subcode = 'err '
232 aetools.keysubst(_arguments, self._argmap_error)
233 _arguments['----'] = _object
236 _reply, _arguments, _attributes = self.send(_code, _subcode,
237 _arguments, _attributes)
238 if _arguments.has_key('errn'):
239 raise aetools.Error, aetools.decodeerror(_arguments)
240 # XXXX Optionally decode result
241 if _arguments.has_key('----'):
242 return _arguments['----']
244 _argmap_Call_a5_subroutine = {
245 'at' : 'at ',
246 '_from' : 'from',
247 '_for' : 'for ',
248 'to' : 'to ',
249 'thru' : 'thru',
250 'through' : 'thgh',
251 'by' : 'by ',
252 'on' : 'on ',
253 'into' : 'into',
254 'onto' : 'onto',
255 'between' : 'btwn',
256 'against' : 'agst',
257 'out_of' : 'outo',
258 'instead_of' : 'isto',
259 'aside_from' : 'asdf',
260 'around' : 'arnd',
261 'beside' : 'bsid',
262 'beneath' : 'bnth',
263 'under' : 'undr',
264 'over' : 'over',
265 'above' : 'abve',
266 'below' : 'belw',
267 'apart_from' : 'aprt',
268 'given' : 'givn',
269 'with' : 'with',
270 'without' : 'wout',
271 'about' : 'abou',
272 'since' : 'snce',
273 'until' : 'till',
274 'returning' : 'Krtn',
277 def Call_a5_subroutine(self, _object=None, _attributes={}, **_arguments):
278 """Call€subroutine: A subroutine call
279 Required argument: anything
280 Keyword argument at: a preposition
281 Keyword argument _from: a preposition
282 Keyword argument _for: a preposition
283 Keyword argument to: a preposition
284 Keyword argument thru: a preposition
285 Keyword argument through: a preposition
286 Keyword argument by: a preposition
287 Keyword argument on: a preposition
288 Keyword argument into: a preposition
289 Keyword argument onto: a preposition
290 Keyword argument between: a preposition
291 Keyword argument against: a preposition
292 Keyword argument out_of: a preposition
293 Keyword argument instead_of: a preposition
294 Keyword argument aside_from: a preposition
295 Keyword argument around: a preposition
296 Keyword argument beside: a preposition
297 Keyword argument beneath: a preposition
298 Keyword argument under: a preposition
299 Keyword argument over: a preposition
300 Keyword argument above: a preposition
301 Keyword argument below: a preposition
302 Keyword argument apart_from: a preposition
303 Keyword argument given: a preposition
304 Keyword argument with: special preposition for setting event properties
305 Keyword argument without: special preposition for clearing event properties
306 Keyword argument about: a preposition
307 Keyword argument since: a preposition
308 Keyword argument until: a preposition
309 Keyword argument returning: specifies a pattern to match results to
310 Keyword argument _attributes: AppleEvent attribute dictionary
311 Returns: anything
313 _code = 'ascr'
314 _subcode = 'psbr'
316 aetools.keysubst(_arguments, self._argmap_Call_a5_subroutine)
317 _arguments['----'] = _object
320 _reply, _arguments, _attributes = self.send(_code, _subcode,
321 _arguments, _attributes)
322 if _arguments.has_key('errn'):
323 raise aetools.Error, aetools.decodeerror(_arguments)
324 # XXXX Optionally decode result
325 if _arguments.has_key('----'):
326 return _arguments['----']
328 def _3d_(self, _object, _attributes={}, **_arguments):
329 """=: Equality
330 Required argument: an AE object reference
331 Keyword argument _attributes: AppleEvent attribute dictionary
332 Returns: anything
334 _code = 'ascr'
335 _subcode = '= '
337 if _arguments: raise TypeError, 'No optional args expected'
338 _arguments['----'] = _object
341 _reply, _arguments, _attributes = self.send(_code, _subcode,
342 _arguments, _attributes)
343 if _arguments.has_key('errn'):
344 raise aetools.Error, aetools.decodeerror(_arguments)
345 # XXXX Optionally decode result
346 if _arguments.has_key('----'):
347 return _arguments['----']
349 def _ad_(self, _object, _attributes={}, **_arguments):
350 """‚: Inequality
351 Required argument: an AE object reference
352 Keyword argument _attributes: AppleEvent attribute dictionary
353 Returns: anything
355 _code = 'ascr'
356 _subcode = '\255 '
358 if _arguments: raise TypeError, 'No optional args expected'
359 _arguments['----'] = _object
362 _reply, _arguments, _attributes = self.send(_code, _subcode,
363 _arguments, _attributes)
364 if _arguments.has_key('errn'):
365 raise aetools.Error, aetools.decodeerror(_arguments)
366 # XXXX Optionally decode result
367 if _arguments.has_key('----'):
368 return _arguments['----']
370 def _2b_(self, _object, _attributes={}, **_arguments):
371 """+: Addition
372 Required argument: an AE object reference
373 Keyword argument _attributes: AppleEvent attribute dictionary
374 Returns: anything
376 _code = 'ascr'
377 _subcode = '+ '
379 if _arguments: raise TypeError, 'No optional args expected'
380 _arguments['----'] = _object
383 _reply, _arguments, _attributes = self.send(_code, _subcode,
384 _arguments, _attributes)
385 if _arguments.has_key('errn'):
386 raise aetools.Error, aetools.decodeerror(_arguments)
387 # XXXX Optionally decode result
388 if _arguments.has_key('----'):
389 return _arguments['----']
391 def _2d_(self, _object, _attributes={}, **_arguments):
392 """-: Subtraction
393 Required argument: an AE object reference
394 Keyword argument _attributes: AppleEvent attribute dictionary
395 Returns: anything
397 _code = 'ascr'
398 _subcode = '- '
400 if _arguments: raise TypeError, 'No optional args expected'
401 _arguments['----'] = _object
404 _reply, _arguments, _attributes = self.send(_code, _subcode,
405 _arguments, _attributes)
406 if _arguments.has_key('errn'):
407 raise aetools.Error, aetools.decodeerror(_arguments)
408 # XXXX Optionally decode result
409 if _arguments.has_key('----'):
410 return _arguments['----']
412 def _2a_(self, _object, _attributes={}, **_arguments):
413 """*: Multiplication
414 Required argument: an AE object reference
415 Keyword argument _attributes: AppleEvent attribute dictionary
416 Returns: anything
418 _code = 'ascr'
419 _subcode = '* '
421 if _arguments: raise TypeError, 'No optional args expected'
422 _arguments['----'] = _object
425 _reply, _arguments, _attributes = self.send(_code, _subcode,
426 _arguments, _attributes)
427 if _arguments.has_key('errn'):
428 raise aetools.Error, aetools.decodeerror(_arguments)
429 # XXXX Optionally decode result
430 if _arguments.has_key('----'):
431 return _arguments['----']
433 def _d6_(self, _object, _attributes={}, **_arguments):
434 """÷: Division
435 Required argument: an AE object reference
436 Keyword argument _attributes: AppleEvent attribute dictionary
437 Returns: anything
439 _code = 'ascr'
440 _subcode = '/ '
442 if _arguments: raise TypeError, 'No optional args expected'
443 _arguments['----'] = _object
446 _reply, _arguments, _attributes = self.send(_code, _subcode,
447 _arguments, _attributes)
448 if _arguments.has_key('errn'):
449 raise aetools.Error, aetools.decodeerror(_arguments)
450 # XXXX Optionally decode result
451 if _arguments.has_key('----'):
452 return _arguments['----']
454 def div(self, _object, _attributes={}, **_arguments):
455 """div: Quotient
456 Required argument: an AE object reference
457 Keyword argument _attributes: AppleEvent attribute dictionary
458 Returns: anything
460 _code = 'ascr'
461 _subcode = 'div '
463 if _arguments: raise TypeError, 'No optional args expected'
464 _arguments['----'] = _object
467 _reply, _arguments, _attributes = self.send(_code, _subcode,
468 _arguments, _attributes)
469 if _arguments.has_key('errn'):
470 raise aetools.Error, aetools.decodeerror(_arguments)
471 # XXXX Optionally decode result
472 if _arguments.has_key('----'):
473 return _arguments['----']
475 def mod(self, _object, _attributes={}, **_arguments):
476 """mod: Remainder
477 Required argument: an AE object reference
478 Keyword argument _attributes: AppleEvent attribute dictionary
479 Returns: anything
481 _code = 'ascr'
482 _subcode = 'mod '
484 if _arguments: raise TypeError, 'No optional args expected'
485 _arguments['----'] = _object
488 _reply, _arguments, _attributes = self.send(_code, _subcode,
489 _arguments, _attributes)
490 if _arguments.has_key('errn'):
491 raise aetools.Error, aetools.decodeerror(_arguments)
492 # XXXX Optionally decode result
493 if _arguments.has_key('----'):
494 return _arguments['----']
496 def _5e_(self, _object, _attributes={}, **_arguments):
497 """^: Exponentiation
498 Required argument: an AE object reference
499 Keyword argument _attributes: AppleEvent attribute dictionary
500 Returns: anything
502 _code = 'ascr'
503 _subcode = '^ '
505 if _arguments: raise TypeError, 'No optional args expected'
506 _arguments['----'] = _object
509 _reply, _arguments, _attributes = self.send(_code, _subcode,
510 _arguments, _attributes)
511 if _arguments.has_key('errn'):
512 raise aetools.Error, aetools.decodeerror(_arguments)
513 # XXXX Optionally decode result
514 if _arguments.has_key('----'):
515 return _arguments['----']
517 def _3e_(self, _object, _attributes={}, **_arguments):
518 """>: Greater than
519 Required argument: an AE object reference
520 Keyword argument _attributes: AppleEvent attribute dictionary
521 Returns: anything
523 _code = 'ascr'
524 _subcode = '> '
526 if _arguments: raise TypeError, 'No optional args expected'
527 _arguments['----'] = _object
530 _reply, _arguments, _attributes = self.send(_code, _subcode,
531 _arguments, _attributes)
532 if _arguments.has_key('errn'):
533 raise aetools.Error, aetools.decodeerror(_arguments)
534 # XXXX Optionally decode result
535 if _arguments.has_key('----'):
536 return _arguments['----']
538 def _b3_(self, _object, _attributes={}, **_arguments):
539 """„: Greater than or equal to
540 Required argument: an AE object reference
541 Keyword argument _attributes: AppleEvent attribute dictionary
542 Returns: anything
544 _code = 'ascr'
545 _subcode = '>= '
547 if _arguments: raise TypeError, 'No optional args expected'
548 _arguments['----'] = _object
551 _reply, _arguments, _attributes = self.send(_code, _subcode,
552 _arguments, _attributes)
553 if _arguments.has_key('errn'):
554 raise aetools.Error, aetools.decodeerror(_arguments)
555 # XXXX Optionally decode result
556 if _arguments.has_key('----'):
557 return _arguments['----']
559 def _3c_(self, _object, _attributes={}, **_arguments):
560 """<: Less than
561 Required argument: an AE object reference
562 Keyword argument _attributes: AppleEvent attribute dictionary
563 Returns: anything
565 _code = 'ascr'
566 _subcode = '< '
568 if _arguments: raise TypeError, 'No optional args expected'
569 _arguments['----'] = _object
572 _reply, _arguments, _attributes = self.send(_code, _subcode,
573 _arguments, _attributes)
574 if _arguments.has_key('errn'):
575 raise aetools.Error, aetools.decodeerror(_arguments)
576 # XXXX Optionally decode result
577 if _arguments.has_key('----'):
578 return _arguments['----']
580 def _b2_(self, _object, _attributes={}, **_arguments):
581 """¾: Less than or equal to
582 Required argument: an AE object reference
583 Keyword argument _attributes: AppleEvent attribute dictionary
584 Returns: anything
586 _code = 'ascr'
587 _subcode = '<= '
589 if _arguments: raise TypeError, 'No optional args expected'
590 _arguments['----'] = _object
593 _reply, _arguments, _attributes = self.send(_code, _subcode,
594 _arguments, _attributes)
595 if _arguments.has_key('errn'):
596 raise aetools.Error, aetools.decodeerror(_arguments)
597 # XXXX Optionally decode result
598 if _arguments.has_key('----'):
599 return _arguments['----']
601 def _26_(self, _object, _attributes={}, **_arguments):
602 """&: Concatenation
603 Required argument: an AE object reference
604 Keyword argument _attributes: AppleEvent attribute dictionary
605 Returns: anything
607 _code = 'ascr'
608 _subcode = 'ccat'
610 if _arguments: raise TypeError, 'No optional args expected'
611 _arguments['----'] = _object
614 _reply, _arguments, _attributes = self.send(_code, _subcode,
615 _arguments, _attributes)
616 if _arguments.has_key('errn'):
617 raise aetools.Error, aetools.decodeerror(_arguments)
618 # XXXX Optionally decode result
619 if _arguments.has_key('----'):
620 return _arguments['----']
622 def starts_with(self, _object, _attributes={}, **_arguments):
623 """starts with: Starts with
624 Required argument: an AE object reference
625 Keyword argument _attributes: AppleEvent attribute dictionary
626 Returns: anything
628 _code = 'ascr'
629 _subcode = 'bgwt'
631 if _arguments: raise TypeError, 'No optional args expected'
632 _arguments['----'] = _object
635 _reply, _arguments, _attributes = self.send(_code, _subcode,
636 _arguments, _attributes)
637 if _arguments.has_key('errn'):
638 raise aetools.Error, aetools.decodeerror(_arguments)
639 # XXXX Optionally decode result
640 if _arguments.has_key('----'):
641 return _arguments['----']
643 def ends_with(self, _object, _attributes={}, **_arguments):
644 """ends with: Ends with
645 Required argument: an AE object reference
646 Keyword argument _attributes: AppleEvent attribute dictionary
647 Returns: anything
649 _code = 'ascr'
650 _subcode = 'ends'
652 if _arguments: raise TypeError, 'No optional args expected'
653 _arguments['----'] = _object
656 _reply, _arguments, _attributes = self.send(_code, _subcode,
657 _arguments, _attributes)
658 if _arguments.has_key('errn'):
659 raise aetools.Error, aetools.decodeerror(_arguments)
660 # XXXX Optionally decode result
661 if _arguments.has_key('----'):
662 return _arguments['----']
664 def contains(self, _object, _attributes={}, **_arguments):
665 """contains: Containment
666 Required argument: an AE object reference
667 Keyword argument _attributes: AppleEvent attribute dictionary
668 Returns: anything
670 _code = 'ascr'
671 _subcode = 'cont'
673 if _arguments: raise TypeError, 'No optional args expected'
674 _arguments['----'] = _object
677 _reply, _arguments, _attributes = self.send(_code, _subcode,
678 _arguments, _attributes)
679 if _arguments.has_key('errn'):
680 raise aetools.Error, aetools.decodeerror(_arguments)
681 # XXXX Optionally decode result
682 if _arguments.has_key('----'):
683 return _arguments['----']
685 def _and(self, _object, _attributes={}, **_arguments):
686 """and: Logical conjunction
687 Required argument: an AE object reference
688 Keyword argument _attributes: AppleEvent attribute dictionary
689 Returns: anything
691 _code = 'ascr'
692 _subcode = 'AND '
694 if _arguments: raise TypeError, 'No optional args expected'
695 _arguments['----'] = _object
698 _reply, _arguments, _attributes = self.send(_code, _subcode,
699 _arguments, _attributes)
700 if _arguments.has_key('errn'):
701 raise aetools.Error, aetools.decodeerror(_arguments)
702 # XXXX Optionally decode result
703 if _arguments.has_key('----'):
704 return _arguments['----']
706 def _or(self, _object, _attributes={}, **_arguments):
707 """or: Logical disjunction
708 Required argument: an AE object reference
709 Keyword argument _attributes: AppleEvent attribute dictionary
710 Returns: anything
712 _code = 'ascr'
713 _subcode = 'OR '
715 if _arguments: raise TypeError, 'No optional args expected'
716 _arguments['----'] = _object
719 _reply, _arguments, _attributes = self.send(_code, _subcode,
720 _arguments, _attributes)
721 if _arguments.has_key('errn'):
722 raise aetools.Error, aetools.decodeerror(_arguments)
723 # XXXX Optionally decode result
724 if _arguments.has_key('----'):
725 return _arguments['----']
727 def as(self, _object, _attributes={}, **_arguments):
728 """as: Coercion
729 Required argument: an AE object reference
730 Keyword argument _attributes: AppleEvent attribute dictionary
731 Returns: anything
733 _code = 'ascr'
734 _subcode = 'coer'
736 if _arguments: raise TypeError, 'No optional args expected'
737 _arguments['----'] = _object
740 _reply, _arguments, _attributes = self.send(_code, _subcode,
741 _arguments, _attributes)
742 if _arguments.has_key('errn'):
743 raise aetools.Error, aetools.decodeerror(_arguments)
744 # XXXX Optionally decode result
745 if _arguments.has_key('----'):
746 return _arguments['----']
748 def _not(self, _object, _attributes={}, **_arguments):
749 """not: Logical negation
750 Required argument: an AE object reference
751 Keyword argument _attributes: AppleEvent attribute dictionary
752 Returns: anything
754 _code = 'ascr'
755 _subcode = 'NOT '
757 if _arguments: raise TypeError, 'No optional args expected'
758 _arguments['----'] = _object
761 _reply, _arguments, _attributes = self.send(_code, _subcode,
762 _arguments, _attributes)
763 if _arguments.has_key('errn'):
764 raise aetools.Error, aetools.decodeerror(_arguments)
765 # XXXX Optionally decode result
766 if _arguments.has_key('----'):
767 return _arguments['----']
769 def negate(self, _object, _attributes={}, **_arguments):
770 """negate: Numeric negation
771 Required argument: an AE object reference
772 Keyword argument _attributes: AppleEvent attribute dictionary
773 Returns: anything
775 _code = 'ascr'
776 _subcode = 'neg '
778 if _arguments: raise TypeError, 'No optional args expected'
779 _arguments['----'] = _object
782 _reply, _arguments, _attributes = self.send(_code, _subcode,
783 _arguments, _attributes)
784 if _arguments.has_key('errn'):
785 raise aetools.Error, aetools.decodeerror(_arguments)
786 # XXXX Optionally decode result
787 if _arguments.has_key('----'):
788 return _arguments['----']
791 class _empty_ae_name(aetools.ComponentItem):
792 """ - the undefined value"""
793 want = 'undf'
795 class upper_case(aetools.ComponentItem):
796 """upper case - Text with lower case converted to upper case"""
797 want = 'case'
799 class machines(aetools.ComponentItem):
800 """machines - every computer"""
801 want = 'mach'
803 machine = machines
805 class zones(aetools.ComponentItem):
806 """zones - every AppleTalk zone"""
807 want = 'zone'
809 zone = zones
811 class seconds(aetools.ComponentItem):
812 """seconds - more than one second"""
813 want = 'scnd'
815 class item(aetools.ComponentItem):
816 """item - An item of any type"""
817 want = 'cobj'
818 class id(aetools.NProperty):
819 """id - the unique id number of this object"""
820 which = 'ID '
821 want = 'long'
823 items = item
825 class text_items(aetools.ComponentItem):
826 """text items - """
827 want = 'citm'
829 text_item = text_items
831 class date(aetools.ComponentItem):
832 """date - Absolute date and time values"""
833 want = 'ldt '
834 class weekday(aetools.NProperty):
835 """weekday - the day of a week of a date"""
836 which = 'wkdy'
837 want = 'wkdy'
838 class month(aetools.NProperty):
839 """month - the month of a date"""
840 which = 'mnth'
841 want = 'mnth'
842 class day(aetools.NProperty):
843 """day - the day of the month of a date"""
844 which = 'day '
845 want = 'long'
846 class year(aetools.NProperty):
847 """year - the year of a date"""
848 which = 'year'
849 want = 'long'
850 class time(aetools.NProperty):
851 """time - the time since midnight of a date"""
852 which = 'time'
853 want = 'long'
854 class date_string(aetools.NProperty):
855 """date string - the date portion of a date-time value as a string"""
856 which = 'dstr'
857 want = 'TEXT'
858 class time_string(aetools.NProperty):
859 """time string - the time portion of a date-time value as a string"""
860 which = 'tstr'
861 want = 'TEXT'
863 dates = date
865 class month(aetools.ComponentItem):
866 """month - a month"""
867 want = 'mnth'
869 months = month
871 class January(aetools.ComponentItem):
872 """January - It's June in January..."""
873 want = 'jan '
875 class February(aetools.ComponentItem):
876 """February - the month of February"""
877 want = 'feb '
879 class March(aetools.ComponentItem):
880 """March - the month of March"""
881 want = 'mar '
883 class April(aetools.ComponentItem):
884 """April - the month of April"""
885 want = 'apr '
887 class May(aetools.ComponentItem):
888 """May - the very merry month of May"""
889 want = 'may '
891 class June(aetools.ComponentItem):
892 """June - the month of June"""
893 want = 'jun '
895 class July(aetools.ComponentItem):
896 """July - the month of July"""
897 want = 'jul '
899 class August(aetools.ComponentItem):
900 """August - the month of August"""
901 want = 'aug '
903 class September(aetools.ComponentItem):
904 """September - the month of September"""
905 want = 'sep '
907 class October(aetools.ComponentItem):
908 """October - the month of October"""
909 want = 'oct '
911 class November(aetools.ComponentItem):
912 """November - the month of November"""
913 want = 'nov '
915 class December(aetools.ComponentItem):
916 """December - the month of December"""
917 want = 'dec '
919 class weekday(aetools.ComponentItem):
920 """weekday - a weekday"""
921 want = 'wkdy'
923 weekdays = weekday
925 class Sunday(aetools.ComponentItem):
926 """Sunday - Sunday Bloody Sunday"""
927 want = 'sun '
929 class Monday(aetools.ComponentItem):
930 """Monday - Blue Monday"""
931 want = 'mon '
933 class Tuesday(aetools.ComponentItem):
934 """Tuesday - Ruby Tuesday"""
935 want = 'tue '
937 class Wednesday(aetools.ComponentItem):
938 """Wednesday - Wednesday Week"""
939 want = 'wed '
941 class Thursday(aetools.ComponentItem):
942 """Thursday - Thursday Afternoon"""
943 want = 'thu '
945 class Friday(aetools.ComponentItem):
946 """Friday - Friday"""
947 want = 'fri '
949 class Saturday(aetools.ComponentItem):
950 """Saturday - Saturday Night's Alright for Fighting"""
951 want = 'sat '
953 class RGB_color(aetools.ComponentItem):
954 """RGB color - Three numbers specifying red, green, blue color values"""
955 want = 'cRGB'
957 RGB_colors = RGB_color
959 class integer(aetools.ComponentItem):
960 """integer - An integral number"""
961 want = 'long'
963 integers = integer
965 class boolean(aetools.ComponentItem):
966 """boolean - A true or false value"""
967 want = 'bool'
969 booleans = boolean
971 class real(aetools.ComponentItem):
972 """real - A real number"""
973 want = 'doub'
975 reals = real
977 class list(aetools.ComponentItem):
978 """list - An ordered collection of items"""
979 want = 'list'
980 class length(aetools.NProperty):
981 """length - the length of a list"""
982 which = 'leng'
983 want = 'long'
985 lists = list
987 class linked_list(aetools.ComponentItem):
988 """linked list - An ordered collection of items"""
989 want = 'llst'
990 # repeated property length the length of a list
992 linked_lists = linked_list
994 class vector(aetools.ComponentItem):
995 """vector - An ordered collection of items"""
996 want = 'vect'
997 # repeated property length the length of a list
999 vectors = vector
1001 class record(aetools.ComponentItem):
1002 """record - A set of labeled items"""
1003 want = 'reco'
1005 records = record
1007 class script(aetools.ComponentItem):
1008 """script - An AppleScript script"""
1009 want = 'scpt'
1010 class parent(aetools.NProperty):
1011 """parent - the parent of a script"""
1012 which = 'pare'
1013 want = 'scpt'
1015 scripts = script
1017 class string(aetools.ComponentItem):
1018 """string - a sequence of characters"""
1019 want = 'TEXT'
1021 strings = string
1023 class styled_text(aetools.ComponentItem):
1024 """styled text - a sequence of characters with style"""
1025 want = 'STXT'
1027 class number(aetools.ComponentItem):
1028 """number - an integer or floating point number"""
1029 want = 'nmbr'
1031 numbers = number
1033 class _class(aetools.ComponentItem):
1034 """class - the type of a value"""
1035 want = 'pcls'
1036 class inherits(aetools.NProperty):
1037 """inherits - classes to inherit properties from"""
1038 which = 'c@#^'
1039 want = 'pcls'
1041 classes = _class
1043 class event(aetools.ComponentItem):
1044 """event - an AppleEvents event"""
1045 want = 'evnt'
1047 events = event
1049 class property(aetools.ComponentItem):
1050 """property - an AppleEvents property"""
1051 want = 'prop'
1053 properties = property
1055 class constant(aetools.ComponentItem):
1056 """constant - A constant value"""
1057 want = 'enum'
1059 constants = constant
1061 class preposition(aetools.ComponentItem):
1062 """preposition - an AppleEvents preposition"""
1063 want = 'prep'
1065 prepositions = preposition
1067 class key(aetools.ComponentItem):
1068 """key - an AppleEvents key form"""
1069 want = 'keyf'
1071 keys = key
1073 class picture(aetools.ComponentItem):
1074 """picture - A picture"""
1075 want = 'PICT'
1077 pictures = picture
1079 class reference(aetools.ComponentItem):
1080 """reference - An AppleScript reference"""
1081 want = 'obj '
1083 references = reference
1085 class data(aetools.ComponentItem):
1086 """data - An AppleScript raw data object"""
1087 want = 'rdat'
1089 class handler(aetools.ComponentItem):
1090 """handler - An AppleScript handler"""
1091 want = 'hand'
1093 handlers = handler
1095 class list_or_record(aetools.ComponentItem):
1096 """list or record - a list or record"""
1097 want = 'lr '
1099 class list_or_string(aetools.ComponentItem):
1100 """list or string - a list or string"""
1101 want = 'ls '
1103 class list_2c__record_or_text(aetools.ComponentItem):
1104 """list, record or text - a list, record or text"""
1105 want = 'lrs '
1107 class number_or_date(aetools.ComponentItem):
1108 """number or date - a number or date"""
1109 want = 'nd '
1111 class number_2c__date_or_text(aetools.ComponentItem):
1112 """number, date or text - a number, date or text"""
1113 want = 'nds '
1115 class alias(aetools.ComponentItem):
1116 """alias - a reference to an existing file"""
1117 want = 'alis'
1119 aliases = alias
1121 class application(aetools.ComponentItem):
1122 """application - specifies global properties of AppleScript"""
1123 want = 'capp'
1124 class result(aetools.NProperty):
1125 """result - the last result of evaluation"""
1126 which = 'rslt'
1127 want = 'cobj'
1128 class space(aetools.NProperty):
1129 """space - a space character"""
1130 which = 'spac'
1131 want = 'TEXT'
1132 class _return(aetools.NProperty):
1133 """return - a return character"""
1134 which = 'ret '
1135 want = 'TEXT'
1136 class tab(aetools.NProperty):
1137 """tab - a tab character"""
1138 which = 'tab '
1139 want = 'TEXT'
1140 class minutes(aetools.NProperty):
1141 """minutes - the number of seconds in a minute"""
1142 which = 'min '
1143 want = 'TEXT'
1144 class hours(aetools.NProperty):
1145 """hours - the number of seconds in an hour"""
1146 which = 'hour'
1147 want = 'TEXT'
1148 class days(aetools.NProperty):
1149 """days - the number of seconds in a day"""
1150 which = 'days'
1151 want = 'TEXT'
1152 class weeks(aetools.NProperty):
1153 """weeks - the number of seconds in a week"""
1154 which = 'week'
1155 want = 'TEXT'
1156 class pi(aetools.NProperty):
1157 """pi - the constant pi"""
1158 which = 'pi '
1159 want = 'doub'
1160 class print_length(aetools.NProperty):
1161 """print length - the maximum length to print"""
1162 which = 'prln'
1163 want = 'long'
1164 class print_depth(aetools.NProperty):
1165 """print depth - the maximum depth to print"""
1166 which = 'prdp'
1167 want = 'long'
1168 class reverse(aetools.NProperty):
1169 """reverse - the reverse of a list"""
1170 which = 'rvse'
1171 want = 'list'
1172 class rest(aetools.NProperty):
1173 """rest - the rest of a list"""
1174 which = 'rest'
1175 want = 'list'
1176 class text_item_delimiters(aetools.NProperty):
1177 """text item delimiters - the text item delimiters of a string"""
1178 which = 'txdl'
1179 want = 'list'
1180 class AppleScript(aetools.NProperty):
1181 """AppleScript - the top-level script object"""
1182 which = 'ascr'
1183 want = 'scpt'
1185 applications = application
1187 app = application
1189 class version(aetools.ComponentItem):
1190 """version - a version value"""
1191 want = 'vers'
1193 class writing_code_info(aetools.ComponentItem):
1194 """writing code info - Script code and language code of text run"""
1195 want = 'citl'
1196 class script_code(aetools.NProperty):
1197 """script code - the script code for the text"""
1198 which = 'pscd'
1199 want = 'shor'
1200 class language_code(aetools.NProperty):
1201 """language code - the language code for the text"""
1202 which = 'plcd'
1203 want = 'shor'
1205 writing_code_infos = writing_code_info
1206 _empty_ae_name._propdict = {
1208 _empty_ae_name._elemdict = {
1210 upper_case._propdict = {
1212 upper_case._elemdict = {
1214 machines._propdict = {
1216 machines._elemdict = {
1218 zones._propdict = {
1220 zones._elemdict = {
1222 seconds._propdict = {
1224 seconds._elemdict = {
1226 item._propdict = {
1227 'id' : id,
1229 item._elemdict = {
1231 text_items._propdict = {
1233 text_items._elemdict = {
1235 date._propdict = {
1236 'weekday' : weekday,
1237 'month' : month,
1238 'day' : day,
1239 'year' : year,
1240 'time' : time,
1241 'date_string' : date_string,
1242 'time_string' : time_string,
1244 date._elemdict = {
1246 month._propdict = {
1248 month._elemdict = {
1250 January._propdict = {
1252 January._elemdict = {
1254 February._propdict = {
1256 February._elemdict = {
1258 March._propdict = {
1260 March._elemdict = {
1262 April._propdict = {
1264 April._elemdict = {
1266 May._propdict = {
1268 May._elemdict = {
1270 June._propdict = {
1272 June._elemdict = {
1274 July._propdict = {
1276 July._elemdict = {
1278 August._propdict = {
1280 August._elemdict = {
1282 September._propdict = {
1284 September._elemdict = {
1286 October._propdict = {
1288 October._elemdict = {
1290 November._propdict = {
1292 November._elemdict = {
1294 December._propdict = {
1296 December._elemdict = {
1298 weekday._propdict = {
1300 weekday._elemdict = {
1302 Sunday._propdict = {
1304 Sunday._elemdict = {
1306 Monday._propdict = {
1308 Monday._elemdict = {
1310 Tuesday._propdict = {
1312 Tuesday._elemdict = {
1314 Wednesday._propdict = {
1316 Wednesday._elemdict = {
1318 Thursday._propdict = {
1320 Thursday._elemdict = {
1322 Friday._propdict = {
1324 Friday._elemdict = {
1326 Saturday._propdict = {
1328 Saturday._elemdict = {
1330 RGB_color._propdict = {
1332 RGB_color._elemdict = {
1334 integer._propdict = {
1336 integer._elemdict = {
1338 boolean._propdict = {
1340 boolean._elemdict = {
1342 real._propdict = {
1344 real._elemdict = {
1346 list._propdict = {
1347 'length' : length,
1349 list._elemdict = {
1351 linked_list._propdict = {
1352 'length' : length,
1354 linked_list._elemdict = {
1356 vector._propdict = {
1357 'length' : length,
1359 vector._elemdict = {
1361 record._propdict = {
1363 record._elemdict = {
1365 script._propdict = {
1366 'parent' : parent,
1368 script._elemdict = {
1370 string._propdict = {
1372 string._elemdict = {
1374 styled_text._propdict = {
1376 styled_text._elemdict = {
1378 number._propdict = {
1380 number._elemdict = {
1382 _class._propdict = {
1383 'inherits' : inherits,
1385 _class._elemdict = {
1387 event._propdict = {
1389 event._elemdict = {
1391 property._propdict = {
1393 property._elemdict = {
1395 constant._propdict = {
1397 constant._elemdict = {
1399 preposition._propdict = {
1401 preposition._elemdict = {
1403 key._propdict = {
1405 key._elemdict = {
1407 picture._propdict = {
1409 picture._elemdict = {
1411 reference._propdict = {
1413 reference._elemdict = {
1415 data._propdict = {
1417 data._elemdict = {
1419 handler._propdict = {
1421 handler._elemdict = {
1423 list_or_record._propdict = {
1425 list_or_record._elemdict = {
1427 list_or_string._propdict = {
1429 list_or_string._elemdict = {
1431 list_2c__record_or_text._propdict = {
1433 list_2c__record_or_text._elemdict = {
1435 number_or_date._propdict = {
1437 number_or_date._elemdict = {
1439 number_2c__date_or_text._propdict = {
1441 number_2c__date_or_text._elemdict = {
1443 alias._propdict = {
1445 alias._elemdict = {
1447 application._propdict = {
1448 'result' : result,
1449 'space' : space,
1450 '_return' : _return,
1451 'tab' : tab,
1452 'minutes' : minutes,
1453 'hours' : hours,
1454 'days' : days,
1455 'weeks' : weeks,
1456 'pi' : pi,
1457 'print_length' : print_length,
1458 'print_depth' : print_depth,
1459 'reverse' : reverse,
1460 'rest' : rest,
1461 'text_item_delimiters' : text_item_delimiters,
1462 'AppleScript' : AppleScript,
1464 application._elemdict = {
1466 version._propdict = {
1468 version._elemdict = {
1470 writing_code_info._propdict = {
1471 'script_code' : script_code,
1472 'language_code' : language_code,
1474 writing_code_info._elemdict = {
1476 _Enum_cons = {
1477 'case' : 'case', # case
1478 'diacriticals' : 'diac', # diacriticals
1479 'white_space' : 'whit', # white space
1480 'hyphens' : 'hyph', # hyphens
1481 'expansion' : 'expa', # expansion
1482 'punctuation' : 'punc', # punctuation
1483 'application_responses' : 'rmte', # remote event replies
1486 _Enum_boov = {
1487 'true' : 'true', # the true boolean value
1488 'false' : 'fals', # the false boolean value
1491 _Enum_misc = {
1492 'current_application' : 'cura', # the current application
1497 # Indices of types declared in this module
1499 _classdeclarations = {
1500 'jan ' : January,
1501 'PICT' : picture,
1502 'vers' : version,
1503 'sat ' : Saturday,
1504 'nov ' : November,
1505 'ls ' : list_or_string,
1506 'list' : list,
1507 'cRGB' : RGB_color,
1508 'citl' : writing_code_info,
1509 'scnd' : seconds,
1510 'thu ' : Thursday,
1511 'keyf' : key,
1512 'sun ' : Sunday,
1513 'wkdy' : weekday,
1514 'rdat' : data,
1515 'vect' : vector,
1516 'obj ' : reference,
1517 'hand' : handler,
1518 'tue ' : Tuesday,
1519 'dec ' : December,
1520 'enum' : constant,
1521 'nd ' : number_or_date,
1522 'wed ' : Wednesday,
1523 'undf' : _empty_ae_name,
1524 'reco' : record,
1525 'capp' : application,
1526 'cobj' : item,
1527 'prep' : preposition,
1528 'mach' : machines,
1529 'citm' : text_items,
1530 'bool' : boolean,
1531 'nmbr' : number,
1532 'prop' : property,
1533 'long' : integer,
1534 'sep ' : September,
1535 'scpt' : script,
1536 'pcls' : _class,
1537 'alis' : alias,
1538 'mon ' : Monday,
1539 'lr ' : list_or_record,
1540 'jul ' : July,
1541 'fri ' : Friday,
1542 'oct ' : October,
1543 'mar ' : March,
1544 'ldt ' : date,
1545 'lrs ' : list_2c__record_or_text,
1546 'jun ' : June,
1547 'case' : upper_case,
1548 'doub' : real,
1549 'feb ' : February,
1550 'nds ' : number_2c__date_or_text,
1551 'llst' : linked_list,
1552 'STXT' : styled_text,
1553 'aug ' : August,
1554 'TEXT' : string,
1555 'apr ' : April,
1556 'may ' : May,
1557 'zone' : zones,
1558 'evnt' : event,
1559 'mnth' : month,
1562 _propdeclarations = {
1563 'day ' : day,
1564 'rslt' : result,
1565 'time' : time,
1566 'prln' : print_length,
1567 'prdp' : print_depth,
1568 'txdl' : text_item_delimiters,
1569 'days' : days,
1570 'spac' : space,
1571 'hour' : hours,
1572 'pscd' : script_code,
1573 'plcd' : language_code,
1574 'ret ' : _return,
1575 'tstr' : time_string,
1576 'tab ' : tab,
1577 'rvse' : reverse,
1578 'wkdy' : weekday,
1579 'ID ' : id,
1580 'c@#^' : inherits,
1581 'ascr' : AppleScript,
1582 'rest' : rest,
1583 'dstr' : date_string,
1584 'min ' : minutes,
1585 'pi ' : pi,
1586 'leng' : length,
1587 'year' : year,
1588 'pare' : parent,
1589 'mnth' : month,
1590 'week' : weeks,
1593 _compdeclarations = {
1596 _enumdeclarations = {
1597 'cons' : _Enum_cons,
1598 'boov' : _Enum_boov,
1599 'misc' : _Enum_misc,