1 """Suite Standard Suite: Common terms for most applications
4 Generated from /Volumes/Sap/System Folder/Extensions/AppleScript
5 AETE/AEUT resource version 1/0, language 0, script 0
13 from _builtinSuites
.builtin_Suite
import *
14 class Standard_Suite_Events(builtin_Suite_Events
):
16 def open(self
, _object
, _attributes
={}, **_arguments
):
17 """open: Open the specified object(s)
18 Required argument: list of objects to open
19 Keyword argument _attributes: AppleEvent attribute dictionary
24 if _arguments
: raise TypeError, 'No optional args expected'
25 _arguments
['----'] = _object
28 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
29 _arguments
, _attributes
)
30 if _arguments
.get('errn', 0):
31 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
32 # XXXX Optionally decode result
33 if _arguments
.has_key('----'):
34 return _arguments
['----']
36 def run(self
, _no_object
=None, _attributes
={}, **_arguments
):
37 """run: Run an application. Most applications will open an empty, untitled window.
38 Keyword argument _attributes: AppleEvent attribute dictionary
43 if _arguments
: raise TypeError, 'No optional args expected'
44 if _no_object
!= None: raise TypeError, 'No direct arg expected'
47 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
48 _arguments
, _attributes
)
49 if _arguments
.get('errn', 0):
50 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
51 # XXXX Optionally decode result
52 if _arguments
.has_key('----'):
53 return _arguments
['----']
55 def reopen(self
, _no_object
=None, _attributes
={}, **_arguments
):
56 """reopen: Reactivate a running application. Some applications will open a new untitled window if no window is open.
57 Keyword argument _attributes: AppleEvent attribute dictionary
62 if _arguments
: raise TypeError, 'No optional args expected'
63 if _no_object
!= None: raise TypeError, 'No direct arg expected'
66 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
67 _arguments
, _attributes
)
68 if _arguments
.get('errn', 0):
69 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
70 # XXXX Optionally decode result
71 if _arguments
.has_key('----'):
72 return _arguments
['----']
74 def print_(self
, _object
, _attributes
={}, **_arguments
):
75 """print: Print the specified object(s)
76 Required argument: list of objects to print
77 Keyword argument _attributes: AppleEvent attribute dictionary
82 if _arguments
: raise TypeError, 'No optional args expected'
83 _arguments
['----'] = _object
86 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
87 _arguments
, _attributes
)
88 if _arguments
.get('errn', 0):
89 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
90 # XXXX Optionally decode result
91 if _arguments
.has_key('----'):
92 return _arguments
['----']
98 def quit(self
, _no_object
=None, _attributes
={}, **_arguments
):
99 """quit: Quit an application
100 Keyword argument saving: specifies whether to save currently open documents
101 Keyword argument _attributes: AppleEvent attribute dictionary
106 aetools
.keysubst(_arguments
, self
._argmap
_quit
)
107 if _no_object
!= None: raise TypeError, 'No direct arg expected'
109 aetools
.enumsubst(_arguments
, 'savo', _Enum_savo
)
111 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
112 _arguments
, _attributes
)
113 if _arguments
.get('errn', 0):
114 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
115 # XXXX Optionally decode result
116 if _arguments
.has_key('----'):
117 return _arguments
['----']
121 'saving_in' : 'kfil',
124 def close(self
, _object
, _attributes
={}, **_arguments
):
125 """close: Close an object
126 Required argument: the object to close
127 Keyword argument saving: specifies whether changes should be saved before closing
128 Keyword argument saving_in: the file in which to save the object
129 Keyword argument _attributes: AppleEvent attribute dictionary
134 aetools
.keysubst(_arguments
, self
._argmap
_close
)
135 _arguments
['----'] = _object
137 aetools
.enumsubst(_arguments
, 'savo', _Enum_savo
)
139 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
140 _arguments
, _attributes
)
141 if _arguments
.get('errn', 0):
142 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
143 # XXXX Optionally decode result
144 if _arguments
.has_key('----'):
145 return _arguments
['----']
151 def count(self
, _object
, _attributes
={}, **_arguments
):
152 """count: Return the number of elements of an object
153 Required argument: the object whose elements are to be counted
154 Keyword argument each: if specified, restricts counting to objects of this class
155 Keyword argument _attributes: AppleEvent attribute dictionary
156 Returns: the number of elements
161 aetools
.keysubst(_arguments
, self
._argmap
_count
)
162 _arguments
['----'] = _object
165 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
166 _arguments
, _attributes
)
167 if _arguments
.get('errn', 0):
168 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
169 # XXXX Optionally decode result
170 if _arguments
.has_key('----'):
171 return _arguments
['----']
173 def delete(self
, _object
, _attributes
={}, **_arguments
):
174 """delete: Delete an object from its container. Note this does not work on script variables, only on elements of application classes.
175 Required argument: the element to delete
176 Keyword argument _attributes: AppleEvent attribute dictionary
181 if _arguments
: raise TypeError, 'No optional args expected'
182 _arguments
['----'] = _object
185 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
186 _arguments
, _attributes
)
187 if _arguments
.get('errn', 0):
188 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
189 # XXXX Optionally decode result
190 if _arguments
.has_key('----'):
191 return _arguments
['----']
193 _argmap_duplicate
= {
195 'with_properties' : 'prdt',
198 def duplicate(self
, _object
, _attributes
={}, **_arguments
):
199 """duplicate: Duplicate one or more objects
200 Required argument: the object(s) to duplicate
201 Keyword argument to: the new location for the object(s)
202 Keyword argument with_properties: the initial values for properties of the new object that are to be different from the original
203 Keyword argument _attributes: AppleEvent attribute dictionary
204 Returns: to the duplicated object(s)
209 aetools
.keysubst(_arguments
, self
._argmap
_duplicate
)
210 _arguments
['----'] = _object
213 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
214 _arguments
, _attributes
)
215 if _arguments
.get('errn', 0):
216 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
217 # XXXX Optionally decode result
218 if _arguments
.has_key('----'):
219 return _arguments
['----']
221 def exists(self
, _object
, _attributes
={}, **_arguments
):
222 """exists: Verify if an object exists
223 Required argument: the object in question
224 Keyword argument _attributes: AppleEvent attribute dictionary
225 Returns: true if it exists, false if not
230 if _arguments
: raise TypeError, 'No optional args expected'
231 _arguments
['----'] = _object
234 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
235 _arguments
, _attributes
)
236 if _arguments
.get('errn', 0):
237 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
238 # XXXX Optionally decode result
239 if _arguments
.has_key('----'):
240 return _arguments
['----']
245 'with_data' : 'data',
246 'with_properties' : 'prdt',
249 def make(self
, _no_object
=None, _attributes
={}, **_arguments
):
250 """make: Make a new element
251 Keyword argument new: the class of the new element
252 Keyword argument at: the location at which to insert the element
253 Keyword argument with_data: the initial data for the element
254 Keyword argument with_properties: the initial values for the properties of the element
255 Keyword argument _attributes: AppleEvent attribute dictionary
256 Returns: to the new object(s)
261 aetools
.keysubst(_arguments
, self
._argmap
_make
)
262 if _no_object
!= None: raise TypeError, 'No direct arg expected'
265 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
266 _arguments
, _attributes
)
267 if _arguments
.get('errn', 0):
268 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
269 # XXXX Optionally decode result
270 if _arguments
.has_key('----'):
271 return _arguments
['----']
277 def move(self
, _object
, _attributes
={}, **_arguments
):
278 """move: Move object(s) to a new location
279 Required argument: the object(s) to move
280 Keyword argument to: the new location for the object(s)
281 Keyword argument _attributes: AppleEvent attribute dictionary
282 Returns: to the object(s) after they have been moved
287 aetools
.keysubst(_arguments
, self
._argmap
_move
)
288 _arguments
['----'] = _object
291 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
292 _arguments
, _attributes
)
293 if _arguments
.get('errn', 0):
294 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
295 # XXXX Optionally decode result
296 if _arguments
.has_key('----'):
297 return _arguments
['----']
304 def save(self
, _object
, _attributes
={}, **_arguments
):
305 """save: Save an object
306 Required argument: the object to save, usually a document or window
307 Keyword argument in_: the file in which to save the object
308 Keyword argument as: the file type of the document in which to save the data
309 Keyword argument _attributes: AppleEvent attribute dictionary
314 aetools
.keysubst(_arguments
, self
._argmap
_save
)
315 _arguments
['----'] = _object
318 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
319 _arguments
, _attributes
)
320 if _arguments
.get('errn', 0):
321 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
322 # XXXX Optionally decode result
323 if _arguments
.has_key('----'):
324 return _arguments
['----']
326 def select(self
, _object
, _attributes
={}, **_arguments
):
327 """select: Make a selection
328 Required argument: the object to select
329 Keyword argument _attributes: AppleEvent attribute dictionary
334 if _arguments
: raise TypeError, 'No optional args expected'
335 _arguments
['----'] = _object
338 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
339 _arguments
, _attributes
)
340 if _arguments
.get('errn', 0):
341 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
342 # XXXX Optionally decode result
343 if _arguments
.has_key('----'):
344 return _arguments
['----']
346 _argmap_data_size
= {
350 def data_size(self
, _object
, _attributes
={}, **_arguments
):
351 """data size: (optional) Return the size in bytes of an object
352 Required argument: the object whose data size is to be returned
353 Keyword argument as: the data type for which the size is calculated
354 Keyword argument _attributes: AppleEvent attribute dictionary
355 Returns: the size of the object in bytes
360 aetools
.keysubst(_arguments
, self
._argmap
_data
_size
)
361 _arguments
['----'] = _object
364 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
365 _arguments
, _attributes
)
366 if _arguments
.get('errn', 0):
367 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
368 # XXXX Optionally decode result
369 if _arguments
.has_key('----'):
370 return _arguments
['----']
372 _argmap_suite_info
= {
376 def suite_info(self
, _object
, _attributes
={}, **_arguments
):
377 """suite info: (optional) Get information about event suite(s)
378 Required argument: the suite for which to return information
379 Keyword argument in_: the human language and script system in which to return information
380 Keyword argument _attributes: AppleEvent attribute dictionary
381 Returns: a record containing the suites and their versions
386 aetools
.keysubst(_arguments
, self
._argmap
_suite
_info
)
387 _arguments
['----'] = _object
390 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
391 _arguments
, _attributes
)
392 if _arguments
.get('errn', 0):
393 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
394 # XXXX Optionally decode result
395 if _arguments
.has_key('----'):
396 return _arguments
['----']
398 _argmap_event_info
= {
402 def event_info(self
, _object
, _attributes
={}, **_arguments
):
403 """event info: (optional) Get information about the Apple events in a suite
404 Required argument: the event class of the Apple events for which to return information
405 Keyword argument in_: the human language and script system in which to return information
406 Keyword argument _attributes: AppleEvent attribute dictionary
407 Returns: a record containing the events and their parameters
412 aetools
.keysubst(_arguments
, self
._argmap
_event
_info
)
413 _arguments
['----'] = _object
416 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
417 _arguments
, _attributes
)
418 if _arguments
.get('errn', 0):
419 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
420 # XXXX Optionally decode result
421 if _arguments
.has_key('----'):
422 return _arguments
['----']
424 _argmap_class_info
= {
428 def class_info(self
, _object
=None, _attributes
={}, **_arguments
):
429 """class info: (optional) Get information about an object class
430 Required argument: the object class about which information is requested
431 Keyword argument in_: the human language and script system in which to return information
432 Keyword argument _attributes: AppleEvent attribute dictionary
433 Returns: a record containing the object\xd5s properties and elements
438 aetools
.keysubst(_arguments
, self
._argmap
_class
_info
)
439 _arguments
['----'] = _object
442 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
443 _arguments
, _attributes
)
444 if _arguments
.get('errn', 0):
445 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
446 # XXXX Optionally decode result
447 if _arguments
.has_key('----'):
448 return _arguments
['----']
451 class application(aetools
.ComponentItem
):
452 """application - An application program """
454 class name(aetools
.NProperty
):
455 """name - the name of the application """
458 class frontmost(aetools
.NProperty
):
459 """frontmost - Is this the frontmost application? """
462 class selection(aetools
.NProperty
):
463 """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. """
466 class clipboard(aetools
.NProperty
):
467 """clipboard - the contents of the clipboard for this application """
470 class version(aetools
.NProperty
):
471 """version - the version of the application """
475 applications
= application
477 class document(aetools
.ComponentItem
):
478 """document - A document of a scriptable application """
480 class modified(aetools
.NProperty
):
481 """modified - Has the document been modified since the last save? """
487 class file(aetools
.ComponentItem
):
488 """file - a file on a disk or server (or a file yet to be created) """
490 class stationery(aetools
.NProperty
):
491 """stationery - Is the file a stationery file? """
497 class alias(aetools
.ComponentItem
):
498 """alias - a file on a disk or server. The file must exist when you check the syntax of your script. """
503 class selection_2d_object(aetools
.ComponentItem
):
504 """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. """
506 class contents(aetools
.NProperty
):
507 """contents - the information currently selected. Use \xd4contents of selection\xd5 to get or change information in a document. """
511 class window(aetools
.ComponentItem
):
512 """window - A window """
514 class bounds(aetools
.NProperty
):
515 """bounds - the boundary rectangle for the window """
518 class closeable(aetools
.NProperty
):
519 """closeable - Does the window have a close box? """
522 class titled(aetools
.NProperty
):
523 """titled - Does the window have a title bar? """
526 class index(aetools
.NProperty
):
527 """index - the number of the window """
530 class floating(aetools
.NProperty
):
531 """floating - Does the window float? """
534 class modal(aetools
.NProperty
):
535 """modal - Is the window modal? """
538 class resizable(aetools
.NProperty
):
539 """resizable - Is the window resizable? """
542 class zoomable(aetools
.NProperty
):
543 """zoomable - Is the window zoomable? """
546 class zoomed(aetools
.NProperty
):
547 """zoomed - Is the window zoomed? """
550 class visible(aetools
.NProperty
):
551 """visible - Is the window visible? """
557 class insertion_point(aetools
.ComponentItem
):
558 """insertion point - An insertion location between two objects """
561 insertion_points
= insertion_point
562 application
._superclassnames
= []
563 application
._privpropdict
= {
565 'frontmost' : frontmost
,
566 'selection' : selection
,
567 'clipboard' : clipboard
,
570 application
._privelemdict
= {
572 document
._superclassnames
= []
573 document
._privpropdict
= {
574 'modified' : modified
,
576 document
._privelemdict
= {
578 file._superclassnames
= []
579 file._privpropdict
= {
580 'stationery' : stationery
,
582 file._privelemdict
= {
584 alias
._superclassnames
= []
585 alias
._privpropdict
= {
587 alias
._privelemdict
= {
589 selection_2d_object
._superclassnames
= []
590 selection_2d_object
._privpropdict
= {
591 'contents' : contents
,
593 selection_2d_object
._privelemdict
= {
595 window
._superclassnames
= []
596 window
._privpropdict
= {
598 'closeable' : closeable
,
601 'floating' : floating
,
603 'resizable' : resizable
,
604 'zoomable' : zoomable
,
608 window
._privelemdict
= {
610 insertion_point
._superclassnames
= []
611 insertion_point
._privpropdict
= {
613 insertion_point
._privelemdict
= {
615 class starts_with(aetools
.NComparison
):
616 """starts with - Starts with """
617 class contains(aetools
.NComparison
):
618 """contains - Contains """
619 class ends_with(aetools
.NComparison
):
620 """ends with - Ends with """
621 class _3d_(aetools
.NComparison
):
623 class _3e_(aetools
.NComparison
):
624 """> - Greater than """
625 class _b3_(aetools
.NComparison
):
626 """\xb3 - Greater than or equal to """
627 class _3c_(aetools
.NComparison
):
629 class _b2_(aetools
.NComparison
):
630 """\xb2 - Less than or equal to """
632 'yes' : 'yes ', # Save objects now
633 'no' : 'no ', # Do not save objects
634 'ask' : 'ask ', # Ask the user whether to save
638 'index' : 'indx', # keyform designating indexed access
639 'named' : 'name', # keyform designating named access
640 'id' : 'ID ', # keyform designating access by unique identifier
644 'plain' : 'plan', # Plain
645 'bold' : 'bold', # Bold
646 'italic' : 'ital', # Italic
647 'outline' : 'outl', # Outline
648 'shadow' : 'shad', # Shadow
649 'underline' : 'undl', # Underline
650 'superscript' : 'spsc', # Superscript
651 'subscript' : 'sbsc', # Subscript
652 'strikethrough' : 'strk', # Strikethrough
653 'small_caps' : 'smcp', # Small caps
654 'all_caps' : 'alcp', # All capital letters
655 'all_lowercase' : 'lowc', # Lowercase
656 'condensed' : 'cond', # Condensed
657 'expanded' : 'pexp', # Expanded
658 'hidden' : 'hidn', # Hidden
663 # Indices of types declared in this module
665 _classdeclarations
= {
668 'csel' : selection_2d_object
,
670 'capp' : application
,
671 'cins' : insertion_point
,
675 _propdeclarations
= {
696 _compdeclarations
= {
703 'bgwt' : starts_with
,
707 _enumdeclarations
= {