1 """Suite Standard Suite: Common terms for most applications
4 Generated from /Volumes/Moes/Systeemmap/Extensies/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 _argmap_class_info
= {
20 def class_info(self
, _object
=None, _attributes
={}, **_arguments
):
21 """class info: (optional) Get information about an object class
22 Required argument: the object class about which information is requested
23 Keyword argument in_: the human language and script system in which to return information
24 Keyword argument _attributes: AppleEvent attribute dictionary
25 Returns: a record containing the object\xd5s properties and elements
30 aetools
.keysubst(_arguments
, self
._argmap
_class
_info
)
31 _arguments
['----'] = _object
34 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
35 _arguments
, _attributes
)
36 if _arguments
.get('errn', 0):
37 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
38 # XXXX Optionally decode result
39 if _arguments
.has_key('----'):
40 return _arguments
['----']
47 def close(self
, _object
, _attributes
={}, **_arguments
):
48 """close: Close an object
49 Required argument: the object to close
50 Keyword argument saving: specifies whether changes should be saved before closing
51 Keyword argument saving_in: the file or alias in which to save the object
52 Keyword argument _attributes: AppleEvent attribute dictionary
57 aetools
.keysubst(_arguments
, self
._argmap
_close
)
58 _arguments
['----'] = _object
60 aetools
.enumsubst(_arguments
, 'savo', _Enum_savo
)
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 # XXXX Optionally decode result
67 if _arguments
.has_key('----'):
68 return _arguments
['----']
74 def count(self
, _object
, _attributes
={}, **_arguments
):
75 """count: Return the number of elements of an object
76 Required argument: the object whose elements are to be counted
77 Keyword argument each: if specified, restricts counting to objects of this class
78 Keyword argument _attributes: AppleEvent attribute dictionary
79 Returns: the number of elements
84 aetools
.keysubst(_arguments
, self
._argmap
_count
)
85 _arguments
['----'] = _object
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 # XXXX Optionally decode result
93 if _arguments
.has_key('----'):
94 return _arguments
['----']
100 def data_size(self
, _object
, _attributes
={}, **_arguments
):
101 """data size: (optional) Return the size in bytes of an object
102 Required argument: the object whose data size is to be returned
103 Keyword argument as: the data type for which the size is calculated
104 Keyword argument _attributes: AppleEvent attribute dictionary
105 Returns: the size of the object in bytes
110 aetools
.keysubst(_arguments
, self
._argmap
_data
_size
)
111 _arguments
['----'] = _object
114 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
115 _arguments
, _attributes
)
116 if _arguments
.get('errn', 0):
117 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
118 # XXXX Optionally decode result
119 if _arguments
.has_key('----'):
120 return _arguments
['----']
122 def delete(self
, _object
, _attributes
={}, **_arguments
):
123 """delete: Delete an object from its container. Note this does not work on script variables, only on elements of application classes.
124 Required argument: the element to delete
125 Keyword argument _attributes: AppleEvent attribute dictionary
130 if _arguments
: raise TypeError, 'No optional args expected'
131 _arguments
['----'] = _object
134 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
135 _arguments
, _attributes
)
136 if _arguments
.get('errn', 0):
137 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
138 # XXXX Optionally decode result
139 if _arguments
.has_key('----'):
140 return _arguments
['----']
142 _argmap_duplicate
= {
144 'with_properties' : 'prdt',
147 def duplicate(self
, _object
, _attributes
={}, **_arguments
):
148 """duplicate: Duplicate one or more objects
149 Required argument: the object(s) to duplicate
150 Keyword argument to: the new location for the object(s)
151 Keyword argument with_properties: the initial values for properties of the new object that are to be different from the original
152 Keyword argument _attributes: AppleEvent attribute dictionary
153 Returns: to the duplicated object(s)
158 aetools
.keysubst(_arguments
, self
._argmap
_duplicate
)
159 _arguments
['----'] = _object
162 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
163 _arguments
, _attributes
)
164 if _arguments
.get('errn', 0):
165 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
166 # XXXX Optionally decode result
167 if _arguments
.has_key('----'):
168 return _arguments
['----']
170 _argmap_event_info
= {
174 def event_info(self
, _object
, _attributes
={}, **_arguments
):
175 """event info: (optional) Get information about the Apple events in a suite
176 Required argument: the event class of the Apple events for which to return information
177 Keyword argument in_: the human language and script system in which to return information
178 Keyword argument _attributes: AppleEvent attribute dictionary
179 Returns: a record containing the events and their parameters
184 aetools
.keysubst(_arguments
, self
._argmap
_event
_info
)
185 _arguments
['----'] = _object
188 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
189 _arguments
, _attributes
)
190 if _arguments
.get('errn', 0):
191 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
192 # XXXX Optionally decode result
193 if _arguments
.has_key('----'):
194 return _arguments
['----']
196 def exists(self
, _object
, _attributes
={}, **_arguments
):
197 """exists: Verify if an object exists
198 Required argument: the object in question
199 Keyword argument _attributes: AppleEvent attribute dictionary
200 Returns: true if it exists, false if not
205 if _arguments
: raise TypeError, 'No optional args expected'
206 _arguments
['----'] = _object
209 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
210 _arguments
, _attributes
)
211 if _arguments
.get('errn', 0):
212 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
213 # XXXX Optionally decode result
214 if _arguments
.has_key('----'):
215 return _arguments
['----']
220 'with_data' : 'data',
221 'with_properties' : 'prdt',
224 def make(self
, _no_object
=None, _attributes
={}, **_arguments
):
225 """make: Make a new element
226 Keyword argument new: the class of the new element
227 Keyword argument at: the location at which to insert the element
228 Keyword argument with_data: the initial data for the element
229 Keyword argument with_properties: the initial values for the properties of the element
230 Keyword argument _attributes: AppleEvent attribute dictionary
231 Returns: to the new object(s)
236 aetools
.keysubst(_arguments
, self
._argmap
_make
)
237 if _no_object
!= None: raise TypeError, 'No direct arg expected'
240 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
241 _arguments
, _attributes
)
242 if _arguments
.get('errn', 0):
243 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
244 # XXXX Optionally decode result
245 if _arguments
.has_key('----'):
246 return _arguments
['----']
252 def move(self
, _object
, _attributes
={}, **_arguments
):
253 """move: Move object(s) to a new location
254 Required argument: the object(s) to move
255 Keyword argument to: the new location for the object(s)
256 Keyword argument _attributes: AppleEvent attribute dictionary
257 Returns: to the object(s) after they have been moved
262 aetools
.keysubst(_arguments
, self
._argmap
_move
)
263 _arguments
['----'] = _object
266 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
267 _arguments
, _attributes
)
268 if _arguments
.get('errn', 0):
269 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
270 # XXXX Optionally decode result
271 if _arguments
.has_key('----'):
272 return _arguments
['----']
274 def open(self
, _object
, _attributes
={}, **_arguments
):
275 """open: Open the specified object(s)
276 Required argument: list of objects to open
277 Keyword argument _attributes: AppleEvent attribute dictionary
282 if _arguments
: raise TypeError, 'No optional args expected'
283 _arguments
['----'] = _object
286 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
287 _arguments
, _attributes
)
288 if _arguments
.get('errn', 0):
289 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
290 # XXXX Optionally decode result
291 if _arguments
.has_key('----'):
292 return _arguments
['----']
294 def print_(self
, _object
, _attributes
={}, **_arguments
):
295 """print: Print the specified object(s)
296 Required argument: list of objects to print
297 Keyword argument _attributes: AppleEvent attribute dictionary
302 if _arguments
: raise TypeError, 'No optional args expected'
303 _arguments
['----'] = _object
306 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
307 _arguments
, _attributes
)
308 if _arguments
.get('errn', 0):
309 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
310 # XXXX Optionally decode result
311 if _arguments
.has_key('----'):
312 return _arguments
['----']
318 def quit(self
, _no_object
=None, _attributes
={}, **_arguments
):
319 """quit: Quit an application
320 Keyword argument saving: specifies whether to save currently open documents
321 Keyword argument _attributes: AppleEvent attribute dictionary
326 aetools
.keysubst(_arguments
, self
._argmap
_quit
)
327 if _no_object
!= None: raise TypeError, 'No direct arg expected'
329 aetools
.enumsubst(_arguments
, 'savo', _Enum_savo
)
331 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
332 _arguments
, _attributes
)
333 if _arguments
.get('errn', 0):
334 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
335 # XXXX Optionally decode result
336 if _arguments
.has_key('----'):
337 return _arguments
['----']
339 def reopen(self
, _no_object
=None, _attributes
={}, **_arguments
):
340 """reopen: Reactivate a running application. Some applications will open a new untitled window if no window is open.
341 Keyword argument _attributes: AppleEvent attribute dictionary
346 if _arguments
: raise TypeError, 'No optional args expected'
347 if _no_object
!= None: raise TypeError, 'No direct arg expected'
350 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
351 _arguments
, _attributes
)
352 if _arguments
.get('errn', 0):
353 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
354 # XXXX Optionally decode result
355 if _arguments
.has_key('----'):
356 return _arguments
['----']
358 def run(self
, _no_object
=None, _attributes
={}, **_arguments
):
359 """run: Run an application. Most applications will open an empty, untitled window.
360 Keyword argument _attributes: AppleEvent attribute dictionary
365 if _arguments
: raise TypeError, 'No optional args expected'
366 if _no_object
!= None: raise TypeError, 'No direct arg expected'
369 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
370 _arguments
, _attributes
)
371 if _arguments
.get('errn', 0):
372 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
373 # XXXX Optionally decode result
374 if _arguments
.has_key('----'):
375 return _arguments
['----']
382 def save(self
, _object
, _attributes
={}, **_arguments
):
383 """save: Save an object
384 Required argument: the object to save, usually a document or window
385 Keyword argument in_: the file or alias in which to save the object
386 Keyword argument as: the file type of the document in which to save the data
387 Keyword argument _attributes: AppleEvent attribute dictionary
392 aetools
.keysubst(_arguments
, self
._argmap
_save
)
393 _arguments
['----'] = _object
396 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
397 _arguments
, _attributes
)
398 if _arguments
.get('errn', 0):
399 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
400 # XXXX Optionally decode result
401 if _arguments
.has_key('----'):
402 return _arguments
['----']
404 def select(self
, _object
, _attributes
={}, **_arguments
):
405 """select: Make a selection
406 Required argument: the object to select
407 Keyword argument _attributes: AppleEvent attribute dictionary
412 if _arguments
: raise TypeError, 'No optional args expected'
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_suite_info
= {
428 def suite_info(self
, _object
, _attributes
={}, **_arguments
):
429 """suite info: (optional) Get information about event suite(s)
430 Required argument: the suite for which to return information
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 suites and their versions
438 aetools
.keysubst(_arguments
, self
._argmap
_suite
_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 aliases(aetools
.ComponentItem
):
457 class application(aetools
.ComponentItem
):
458 """application - An application program """
460 class _Prop_clipboard(aetools
.NProperty
):
461 """clipboard - the contents of the clipboard for this application """
464 class _Prop_frontmost(aetools
.NProperty
):
465 """frontmost - Is this the frontmost application? """
468 class _Prop_name(aetools
.NProperty
):
469 """name - the name of the application """
472 class _Prop_selection(aetools
.NProperty
):
473 """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. """
476 class _Prop_version(aetools
.NProperty
):
477 """version - the version of the application """
481 applications
= application
483 class insertion_points(aetools
.ComponentItem
):
484 """insertion points - """
487 insertion_point
= insertion_points
489 class selection_2d_object(aetools
.ComponentItem
):
490 """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. """
492 class _Prop_contents(aetools
.NProperty
):
493 """contents - the information currently selected. Use \xd4contents of selection\xd5 to get or change information in a document. """
497 class window(aetools
.ComponentItem
):
498 """window - A window """
500 class _Prop_bounds(aetools
.NProperty
):
501 """bounds - the boundary rectangle for the window """
504 class _Prop_closeable(aetools
.NProperty
):
505 """closeable - Does the window have a close box? """
508 class _Prop_floating(aetools
.NProperty
):
509 """floating - Does the window float? """
512 class _Prop_index(aetools
.NProperty
):
513 """index - the number of the window """
516 class _Prop_modal(aetools
.NProperty
):
517 """modal - Is the window modal? """
520 class _Prop_resizable(aetools
.NProperty
):
521 """resizable - Is the window resizable? """
524 class _Prop_titled(aetools
.NProperty
):
525 """titled - Does the window have a title bar? """
528 class _Prop_visible(aetools
.NProperty
):
529 """visible - Is the window visible? """
532 class _Prop_zoomable(aetools
.NProperty
):
533 """zoomable - Is the window zoomable? """
536 class _Prop_zoomed(aetools
.NProperty
):
537 """zoomed - Is the window zoomed? """
543 class document(aetools
.ComponentItem
):
544 """document - A document of a scriptable application """
546 class _Prop_modified(aetools
.NProperty
):
547 """modified - Has the document been modified since the last save? """
553 class file(aetools
.ComponentItem
):
554 """file - a file on a disk or server """
556 class _Prop_stationery(aetools
.NProperty
):
557 """stationery - Is the file a stationery file? """
562 aliases
._superclassnames
= []
563 aliases
._privpropdict
= {
565 aliases
._privelemdict
= {
567 application
._superclassnames
= []
568 application
._privpropdict
= {
569 'clipboard' : _Prop_clipboard
,
570 'frontmost' : _Prop_frontmost
,
572 'selection' : _Prop_selection
,
573 'version' : _Prop_version
,
575 application
._privelemdict
= {
577 insertion_points
._superclassnames
= []
578 insertion_points
._privpropdict
= {
580 insertion_points
._privelemdict
= {
582 selection_2d_object
._superclassnames
= []
583 selection_2d_object
._privpropdict
= {
584 'contents' : _Prop_contents
,
586 selection_2d_object
._privelemdict
= {
588 window
._superclassnames
= []
589 window
._privpropdict
= {
590 'bounds' : _Prop_bounds
,
591 'closeable' : _Prop_closeable
,
592 'floating' : _Prop_floating
,
593 'index' : _Prop_index
,
594 'modal' : _Prop_modal
,
595 'resizable' : _Prop_resizable
,
596 'titled' : _Prop_titled
,
597 'visible' : _Prop_visible
,
598 'zoomable' : _Prop_zoomable
,
599 'zoomed' : _Prop_zoomed
,
601 window
._privelemdict
= {
603 document
._superclassnames
= []
604 document
._privpropdict
= {
605 'modified' : _Prop_modified
,
607 document
._privelemdict
= {
609 file._superclassnames
= []
610 file._privpropdict
= {
611 'stationery' : _Prop_stationery
,
613 file._privelemdict
= {
615 class _3c_(aetools
.NComparison
):
617 class _3d_(aetools
.NComparison
):
619 class _3e_(aetools
.NComparison
):
620 """> - Greater than """
621 class contains(aetools
.NComparison
):
622 """contains - Contains """
623 class ends_with(aetools
.NComparison
):
624 """ends with - Ends with """
625 class starts_with(aetools
.NComparison
):
626 """starts with - Starts with """
627 class _b2_(aetools
.NComparison
):
628 """\xb2 - Less than or equal to """
629 class _b3_(aetools
.NComparison
):
630 """\xb3 - Greater than or equal to """
632 'index' : 'indx', # keyform designating indexed access
633 'named' : 'name', # keyform designating named access
634 'id' : 'ID ', # keyform designating access by unique identifier
638 'yes' : 'yes ', # Save objects now
639 'no' : 'no ', # Do not save objects
640 'ask' : 'ask ', # Ask the user whether to save
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
= {
667 'capp' : application
,
668 'cins' : insertion_points
,
669 'csel' : selection_2d_object
,
675 _propdeclarations
= {
676 'hclb' : _Prop_closeable
,
677 'imod' : _Prop_modified
,
678 'isfl' : _Prop_floating
,
679 'iszm' : _Prop_zoomable
,
680 'pbnd' : _Prop_bounds
,
681 'pcli' : _Prop_clipboard
,
682 'pcnt' : _Prop_contents
,
683 'pidx' : _Prop_index
,
684 'pisf' : _Prop_frontmost
,
685 'pmod' : _Prop_modal
,
687 'prsz' : _Prop_resizable
,
688 'pspd' : _Prop_stationery
,
689 'ptit' : _Prop_titled
,
690 'pvis' : _Prop_visible
,
691 'pzum' : _Prop_zoomed
,
692 'sele' : _Prop_selection
,
693 'vers' : _Prop_version
,
696 _compdeclarations
= {
702 'bgwt' : starts_with
,
707 _enumdeclarations
= {