1 """Suite Standard Suite: Common terms for most applications
4 Generated from Macintosh HD:Systeemmap:Extensies:AppleScript
5 AETE/AEUT resource version 1/0, language 0, script 0
13 class Standard_Suite_Events
:
15 def open(self
, _object
, _attributes
={}, **_arguments
):
16 """open: Open the specified object(s)
17 Required argument: list of objects to open
18 Keyword argument _attributes: AppleEvent attribute dictionary
23 if _arguments
: raise TypeError, 'No optional args expected'
24 _arguments
['----'] = _object
27 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
28 _arguments
, _attributes
)
29 if _arguments
.has_key('errn'):
30 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
31 # XXXX Optionally decode result
32 if _arguments
.has_key('----'):
33 return _arguments
['----']
35 def run(self
, _no_object
=None, _attributes
={}, **_arguments
):
36 """run: Run an application. Most applications will open an empty, untitled window.
37 Keyword argument _attributes: AppleEvent attribute dictionary
42 if _arguments
: raise TypeError, 'No optional args expected'
43 if _no_object
!= None: raise TypeError, 'No direct arg expected'
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 reopen(self
, _no_object
=None, _attributes
={}, **_arguments
):
55 """reopen: Reactivate a running application. Some applications will open a new untitled window if no window is open.
56 Keyword argument _attributes: AppleEvent attribute dictionary
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 _print(self
, _object
, _attributes
={}, **_arguments
):
74 """print: Print the specified object(s)
75 Required argument: list of objects to print
76 Keyword argument _attributes: AppleEvent attribute dictionary
81 if _arguments
: raise TypeError, 'No optional args expected'
82 _arguments
['----'] = _object
85 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
86 _arguments
, _attributes
)
87 if _arguments
.has_key('errn'):
88 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
89 # XXXX Optionally decode result
90 if _arguments
.has_key('----'):
91 return _arguments
['----']
97 def quit(self
, _no_object
=None, _attributes
={}, **_arguments
):
98 """quit: Quit an application
99 Keyword argument saving: specifies whether to save currently open documents
100 Keyword argument _attributes: AppleEvent attribute dictionary
105 aetools
.keysubst(_arguments
, self
._argmap
_quit
)
106 if _no_object
!= None: raise TypeError, 'No direct arg expected'
108 aetools
.enumsubst(_arguments
, 'savo', _Enum_savo
)
110 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
111 _arguments
, _attributes
)
112 if _arguments
.has_key('errn'):
113 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
114 # XXXX Optionally decode result
115 if _arguments
.has_key('----'):
116 return _arguments
['----']
120 'saving_in' : 'kfil',
123 def close(self
, _object
, _attributes
={}, **_arguments
):
124 """close: Close an object
125 Required argument: the object to close
126 Keyword argument saving: specifies whether changes should be saved before closing
127 Keyword argument saving_in: the file in which to save the object
128 Keyword argument _attributes: AppleEvent attribute dictionary
133 aetools
.keysubst(_arguments
, self
._argmap
_close
)
134 _arguments
['----'] = _object
136 aetools
.enumsubst(_arguments
, 'savo', _Enum_savo
)
138 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
139 _arguments
, _attributes
)
140 if _arguments
.has_key('errn'):
141 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
142 # XXXX Optionally decode result
143 if _arguments
.has_key('----'):
144 return _arguments
['----']
150 def count(self
, _object
, _attributes
={}, **_arguments
):
151 """count: Return the number of elements of an object
152 Required argument: the object whose elements are to be counted
153 Keyword argument each: if specified, restricts counting to objects of this class
154 Keyword argument _attributes: AppleEvent attribute dictionary
155 Returns: the number of elements
160 aetools
.keysubst(_arguments
, self
._argmap
_count
)
161 _arguments
['----'] = _object
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 delete(self
, _object
, _attributes
={}, **_arguments
):
173 """delete: Delete an object from its container. Note this does not work on script variables, only on elements of application classes.
174 Required argument: the element to delete
175 Keyword argument _attributes: AppleEvent attribute dictionary
180 if _arguments
: raise TypeError, 'No optional args expected'
181 _arguments
['----'] = _object
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 _argmap_duplicate
= {
194 'with_properties' : 'prdt',
197 def duplicate(self
, _object
, _attributes
={}, **_arguments
):
198 """duplicate: Duplicate one or more objects
199 Required argument: the object(s) to duplicate
200 Keyword argument to: the new location for the object(s)
201 Keyword argument with_properties: the initial values for properties of the new object that are to be different from the original
202 Keyword argument _attributes: AppleEvent attribute dictionary
203 Returns: to the duplicated object(s)
208 aetools
.keysubst(_arguments
, self
._argmap
_duplicate
)
209 _arguments
['----'] = _object
212 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
213 _arguments
, _attributes
)
214 if _arguments
.has_key('errn'):
215 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
216 # XXXX Optionally decode result
217 if _arguments
.has_key('----'):
218 return _arguments
['----']
220 def exists(self
, _object
, _attributes
={}, **_arguments
):
221 """exists: Verify if an object exists
222 Required argument: the object in question
223 Keyword argument _attributes: AppleEvent attribute dictionary
224 Returns: true if it exists, false if not
229 if _arguments
: raise TypeError, 'No optional args expected'
230 _arguments
['----'] = _object
233 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
234 _arguments
, _attributes
)
235 if _arguments
.has_key('errn'):
236 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
237 # XXXX Optionally decode result
238 if _arguments
.has_key('----'):
239 return _arguments
['----']
244 'with_data' : 'data',
245 'with_properties' : 'prdt',
248 def make(self
, _no_object
=None, _attributes
={}, **_arguments
):
249 """make: Make a new element
250 Keyword argument new: the class of the new element
251 Keyword argument at: the location at which to insert the element
252 Keyword argument with_data: the initial data for the element
253 Keyword argument with_properties: the initial values for the properties of the element
254 Keyword argument _attributes: AppleEvent attribute dictionary
255 Returns: to the new object(s)
260 aetools
.keysubst(_arguments
, self
._argmap
_make
)
261 if _no_object
!= None: raise TypeError, 'No direct arg expected'
264 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
265 _arguments
, _attributes
)
266 if _arguments
.has_key('errn'):
267 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
268 # XXXX Optionally decode result
269 if _arguments
.has_key('----'):
270 return _arguments
['----']
276 def move(self
, _object
, _attributes
={}, **_arguments
):
277 """move: Move object(s) to a new location
278 Required argument: the object(s) to move
279 Keyword argument to: the new location for the object(s)
280 Keyword argument _attributes: AppleEvent attribute dictionary
281 Returns: to the object(s) after they have been moved
286 aetools
.keysubst(_arguments
, self
._argmap
_move
)
287 _arguments
['----'] = _object
290 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
291 _arguments
, _attributes
)
292 if _arguments
.has_key('errn'):
293 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
294 # XXXX Optionally decode result
295 if _arguments
.has_key('----'):
296 return _arguments
['----']
303 def save(self
, _object
, _attributes
={}, **_arguments
):
304 """save: Save an object
305 Required argument: the object to save, usually a document or window
306 Keyword argument _in: the file in which to save the object
307 Keyword argument as: the file type of the document in which to save the data
308 Keyword argument _attributes: AppleEvent attribute dictionary
313 aetools
.keysubst(_arguments
, self
._argmap
_save
)
314 _arguments
['----'] = _object
317 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
318 _arguments
, _attributes
)
319 if _arguments
.has_key('errn'):
320 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
321 # XXXX Optionally decode result
322 if _arguments
.has_key('----'):
323 return _arguments
['----']
325 def select(self
, _object
, _attributes
={}, **_arguments
):
326 """select: Make a selection
327 Required argument: the object to select
328 Keyword argument _attributes: AppleEvent attribute dictionary
333 if _arguments
: raise TypeError, 'No optional args expected'
334 _arguments
['----'] = _object
337 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
338 _arguments
, _attributes
)
339 if _arguments
.has_key('errn'):
340 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
341 # XXXX Optionally decode result
342 if _arguments
.has_key('----'):
343 return _arguments
['----']
345 _argmap_data_size
= {
349 def data_size(self
, _object
, _attributes
={}, **_arguments
):
350 """data size: (optional) Return the size in bytes of an object
351 Required argument: the object whose data size is to be returned
352 Keyword argument as: the data type for which the size is calculated
353 Keyword argument _attributes: AppleEvent attribute dictionary
354 Returns: the size of the object in bytes
359 aetools
.keysubst(_arguments
, self
._argmap
_data
_size
)
360 _arguments
['----'] = _object
363 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
364 _arguments
, _attributes
)
365 if _arguments
.has_key('errn'):
366 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
367 # XXXX Optionally decode result
368 if _arguments
.has_key('----'):
369 return _arguments
['----']
371 _argmap_suite_info
= {
375 def suite_info(self
, _object
, _attributes
={}, **_arguments
):
376 """suite info: (optional) Get information about event suite(s)
377 Required argument: the suite for which to return information
378 Keyword argument _in: the human language and script system in which to return information
379 Keyword argument _attributes: AppleEvent attribute dictionary
380 Returns: a record containing the suites and their versions
385 aetools
.keysubst(_arguments
, self
._argmap
_suite
_info
)
386 _arguments
['----'] = _object
389 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
390 _arguments
, _attributes
)
391 if _arguments
.has_key('errn'):
392 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
393 # XXXX Optionally decode result
394 if _arguments
.has_key('----'):
395 return _arguments
['----']
397 _argmap_event_info
= {
401 def event_info(self
, _object
, _attributes
={}, **_arguments
):
402 """event info: (optional) Get information about the Apple events in a suite
403 Required argument: the event class of the Apple events for which to return information
404 Keyword argument _in: the human language and script system in which to return information
405 Keyword argument _attributes: AppleEvent attribute dictionary
406 Returns: a record containing the events and their parameters
411 aetools
.keysubst(_arguments
, self
._argmap
_event
_info
)
412 _arguments
['----'] = _object
415 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
416 _arguments
, _attributes
)
417 if _arguments
.has_key('errn'):
418 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
419 # XXXX Optionally decode result
420 if _arguments
.has_key('----'):
421 return _arguments
['----']
423 _argmap_class_info
= {
427 def class_info(self
, _object
=None, _attributes
={}, **_arguments
):
428 """class info: (optional) Get information about an object class
429 Required argument: the object class about which information is requested
430 Keyword argument _in: the human language and script system in which to return information
431 Keyword argument _attributes: AppleEvent attribute dictionary
432 Returns: a record containing the objectÕs properties and elements
437 aetools
.keysubst(_arguments
, self
._argmap
_class
_info
)
438 _arguments
['----'] = _object
441 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
442 _arguments
, _attributes
)
443 if _arguments
.has_key('errn'):
444 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
445 # XXXX Optionally decode result
446 if _arguments
.has_key('----'):
447 return _arguments
['----']
450 class application(aetools
.ComponentItem
):
451 """application - An application program """
453 class name(aetools
.NProperty
):
454 """name - the name of the application """
457 class frontmost(aetools
.NProperty
):
458 """frontmost - Is this the frontmost application? """
461 class selection(aetools
.NProperty
):
462 """selection - the selection visible to the user. Use the •selectÕ command to set a new selection; use •contents of selectionÕ to get or change information in the document. """
465 class clipboard(aetools
.NProperty
):
466 """clipboard - the contents of the clipboard for this application """
469 class version(aetools
.NProperty
):
470 """version - the version of the application """
474 applications
= application
476 class document(aetools
.ComponentItem
):
477 """document - A document of a scriptable application """
479 class modified(aetools
.NProperty
):
480 """modified - Has the document been modified since the last save? """
486 class file(aetools
.ComponentItem
):
487 """file - a file on a disk or server (or a file yet to be created) """
489 class stationery(aetools
.NProperty
):
490 """stationery - Is the file a stationery file? """
496 class alias(aetools
.ComponentItem
):
497 """alias - a file on a disk or server. The file must exist when you check the syntax of your script. """
502 class selection_2d_object(aetools
.ComponentItem
):
503 """selection-object - A way to refer to the state of the current of the selection. Use the •selectÕ command to make a new selection. """
505 class contents(aetools
.NProperty
):
506 """contents - the information currently selected. Use •contents of selectionÕ to get or change information in a document. """
510 class window(aetools
.ComponentItem
):
511 """window - A window """
513 class bounds(aetools
.NProperty
):
514 """bounds - the boundary rectangle for the window """
517 class closeable(aetools
.NProperty
):
518 """closeable - Does the window have a close box? """
521 class titled(aetools
.NProperty
):
522 """titled - Does the window have a title bar? """
525 class index(aetools
.NProperty
):
526 """index - the number of the window """
529 class floating(aetools
.NProperty
):
530 """floating - Does the window float? """
533 class modal(aetools
.NProperty
):
534 """modal - Is the window modal? """
537 class resizable(aetools
.NProperty
):
538 """resizable - Is the window resizable? """
541 class zoomable(aetools
.NProperty
):
542 """zoomable - Is the window zoomable? """
545 class zoomed(aetools
.NProperty
):
546 """zoomed - Is the window zoomed? """
549 class visible(aetools
.NProperty
):
550 """visible - Is the window visible? """
556 class insertion_point(aetools
.ComponentItem
):
557 """insertion point - An insertion location between two objects """
560 insertion_points
= insertion_point
561 application
._propdict
= {
563 'frontmost' : frontmost
,
564 'selection' : selection
,
565 'clipboard' : clipboard
,
568 application
._elemdict
= {
570 document
._propdict
= {
571 'modified' : modified
,
573 document
._elemdict
= {
576 'stationery' : stationery
,
584 selection_2d_object
._propdict
= {
585 'contents' : contents
,
587 selection_2d_object
._elemdict
= {
591 'closeable' : closeable
,
594 'floating' : floating
,
596 'resizable' : resizable
,
597 'zoomable' : zoomable
,
603 insertion_point
._propdict
= {
605 insertion_point
._elemdict
= {
607 class starts_with(aetools
.NComparison
):
608 """starts with - Starts with """
609 class contains(aetools
.NComparison
):
610 """contains - Contains """
611 class ends_with(aetools
.NComparison
):
612 """ends with - Ends with """
613 class _3d_(aetools
.NComparison
):
615 class _3e_(aetools
.NComparison
):
616 """> - Greater than """
617 class _b3_(aetools
.NComparison
):
618 """³ - Greater than or equal to """
619 class _3c_(aetools
.NComparison
):
621 class _b2_(aetools
.NComparison
):
622 """² - Less than or equal to """
624 'yes' : 'yes ', # Save objects now
625 'no' : 'no ', # Do not save objects
626 'ask' : 'ask ', # Ask the user whether to save
630 'index' : 'indx', # keyform designating indexed access
631 'named' : 'name', # keyform designating named access
632 'id' : 'ID ', # keyform designating access by unique identifier
636 'plain' : 'plan', # Plain
637 'bold' : 'bold', # Bold
638 'italic' : 'ital', # Italic
639 'outline' : 'outl', # Outline
640 'shadow' : 'shad', # Shadow
641 'underline' : 'undl', # Underline
642 'superscript' : 'spsc', # Superscript
643 'subscript' : 'sbsc', # Subscript
644 'strikethrough' : 'strk', # Strikethrough
645 'small_caps' : 'smcp', # Small caps
646 'all_caps' : 'alcp', # All capital letters
647 'all_lowercase' : 'lowc', # Lowercase
648 'condensed' : 'cond', # Condensed
649 'expanded' : 'pexp', # Expanded
650 'hidden' : 'hidn', # Hidden
655 # Indices of types declared in this module
657 _classdeclarations
= {
659 'cins' : insertion_point
,
660 'capp' : application
,
662 'csel' : selection_2d_object
,
667 _propdeclarations
= {
688 _compdeclarations
= {
690 'bgwt' : starts_with
,
699 _enumdeclarations
= {