1 """Suite Standard Suite: Common terms for most applications
4 Generated from Macintosh HD:SWdev:CodeWarrior 6 MPTP:Metrowerks CodeWarrior:CodeWarrior IDE 4.1B9
5 AETE/AEUT resource version 1/0, language 0, script 0
13 class Standard_Suite_Events
:
20 def close(self
, _object
, _attributes
={}, **_arguments
):
21 """close: close an object
22 Required argument: the object to close
23 Keyword argument saving: specifies whether or not changes should be saved before closing
24 Keyword argument saving_in: the file in which to save the object
25 Keyword argument _attributes: AppleEvent attribute dictionary
30 aetools
.keysubst(_arguments
, self
._argmap
_close
)
31 _arguments
['----'] = _object
33 aetools
.enumsubst(_arguments
, 'savo', _Enum_savo
)
35 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
36 _arguments
, _attributes
)
37 if _arguments
.has_key('errn'):
38 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
39 # XXXX Optionally decode result
40 if _arguments
.has_key('----'):
41 return _arguments
['----']
47 def count(self
, _object
, _attributes
={}, **_arguments
):
48 """count: return the number of elements of a particular class within an object
49 Required argument: the object whose elements are to be counted
50 Keyword argument each: the class of the elements to be counted. Keyword 'each' is optional in AppleScript
51 Keyword argument _attributes: AppleEvent attribute dictionary
52 Returns: the number of elements
57 aetools
.keysubst(_arguments
, self
._argmap
_count
)
58 _arguments
['----'] = _object
61 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
62 _arguments
, _attributes
)
63 if _arguments
.has_key('errn'):
64 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
65 # XXXX Optionally decode result
66 if _arguments
.has_key('----'):
67 return _arguments
['----']
73 def get(self
, _object
, _attributes
={}, **_arguments
):
74 """get: get the data for an object
75 Required argument: the object whose data is to be returned
76 Keyword argument as: the desired types for the data, in order of preference
77 Keyword argument _attributes: AppleEvent attribute dictionary
78 Returns: The data from the object
83 aetools
.keysubst(_arguments
, self
._argmap
_get
)
84 _arguments
['----'] = _object
87 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
88 _arguments
, _attributes
)
89 if _arguments
.has_key('errn'):
90 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
91 # XXXX Optionally decode result
92 if _arguments
.has_key('----'):
93 return _arguments
['----']
100 'with_properties' : 'prdt',
103 def make(self
, _no_object
=None, _attributes
={}, **_arguments
):
104 """make: make a new element
105 Keyword argument new: the class of the new element„keyword 'new' is optional in AppleScript
106 Keyword argument as: the desired types for the data, in order of preference
107 Keyword argument at: the location at which to insert the element
108 Keyword argument with_data: the initial data for the element
109 Keyword argument with_properties: the initial values for the properties of the element
110 Keyword argument _attributes: AppleEvent attribute dictionary
111 Returns: to the new object(s)
116 aetools
.keysubst(_arguments
, self
._argmap
_make
)
117 if _no_object
!= None: raise TypeError, 'No direct arg expected'
120 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
121 _arguments
, _attributes
)
122 if _arguments
.has_key('errn'):
123 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
124 # XXXX Optionally decode result
125 if _arguments
.has_key('----'):
126 return _arguments
['----']
128 def select(self
, _object
=None, _attributes
={}, **_arguments
):
129 """select: select the specified object
130 Required argument: the object to select
131 Keyword argument _attributes: AppleEvent attribute dictionary
136 if _arguments
: raise TypeError, 'No optional args expected'
137 _arguments
['----'] = _object
140 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
141 _arguments
, _attributes
)
142 if _arguments
.has_key('errn'):
143 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
144 # XXXX Optionally decode result
145 if _arguments
.has_key('----'):
146 return _arguments
['----']
152 def set(self
, _object
, _attributes
={}, **_arguments
):
153 """set: set an object's data
154 Required argument: the object to change
155 Keyword argument to: the new value
156 Keyword argument _attributes: AppleEvent attribute dictionary
161 aetools
.keysubst(_arguments
, self
._argmap
_set
)
162 _arguments
['----'] = _object
165 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
166 _arguments
, _attributes
)
167 if _arguments
.has_key('errn'):
168 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
169 # XXXX Optionally decode result
170 if _arguments
.has_key('----'):
171 return _arguments
['----']
174 class application(aetools
.ComponentItem
):
175 """application - an application program """
177 class user_interaction(aetools
.NProperty
):
178 """user interaction - user interaction level """
181 # element 'docu' as ['indx', 'name', 'rang']
182 # element 'cwin' as ['indx', 'name', 'rang']
184 class character(aetools
.ComponentItem
):
185 """character - a character """
187 class offset(aetools
.NProperty
):
188 """offset - offset of a text object from the beginning of the document (first char has offset 1) """
191 class length(aetools
.NProperty
):
192 """length - length in characters of this object """
196 class document(aetools
.ComponentItem
):
197 """document - a document """
199 class name(aetools
.NProperty
):
200 """name - the title of the document """
203 class kind(aetools
.NProperty
):
204 """kind - the kind of document """
207 class index(aetools
.NProperty
):
208 """index - the number of the document """
211 class location(aetools
.NProperty
):
212 """location - the file of the document """
215 class file_permissions(aetools
.NProperty
):
216 """file permissions - the file permissions for the document """
219 class window(aetools
.NProperty
):
220 """window - the window of the document. """
226 class file(aetools
.ComponentItem
):
232 class insertion_point(aetools
.ComponentItem
):
233 """insertion point - An insertion location between two objects """
235 # repeated property length length of text object (in characters)
236 # repeated property offset offset of a text object from the beginning of the document (first char has offset 1)
238 class line(aetools
.ComponentItem
):
239 """line - lines of text """
241 # repeated property index index of a line object from the beginning of the document (first line has index 1)
242 # repeated property offset offset (in characters) of a line object from the beginning of the document
243 # repeated property length length in characters of this object
244 # element 'cha ' as ['indx', 'rang', 'rele']
248 class selection_2d_object(aetools
.ComponentItem
):
249 """selection-object - the selection visible to the user """
251 class contents(aetools
.NProperty
):
252 """contents - the contents of the selection """
255 # repeated property length length of text object (in characters)
256 # repeated property offset offset of a text object from the beginning of the document (first char has offset 1)
257 # element 'cha ' as ['indx', 'rele', 'rang', 'test']
258 # element 'clin' as ['indx', 'rang', 'rele']
259 # element 'ctxt' as ['rang']
261 class text(aetools
.ComponentItem
):
264 # repeated property length length of text object (in characters)
265 # repeated property offset offset of a text object from the beginning of the document (first char has offset 1)
266 # element 'cha ' as ['indx', 'rele', 'rang']
267 # element 'cins' as ['rele']
268 # element 'clin' as ['indx', 'rang', 'rele']
269 # element 'ctxt' as ['rang']
271 class window(aetools
.ComponentItem
):
272 """window - A window """
274 # repeated property name the title of the window
275 # repeated property index the number of the window
276 class bounds(aetools
.NProperty
):
277 """bounds - the boundary rectangle for the window """
280 class document(aetools
.NProperty
):
281 """document - the document that owns this window """
284 class position(aetools
.NProperty
):
285 """position - upper left coordinates of window """
288 class visible(aetools
.NProperty
):
289 """visible - is the window visible? """
292 class zoomed(aetools
.NProperty
):
293 """zoomed - Is the window zoomed? """
298 application
._propdict
= {
299 'user_interaction' : user_interaction
,
301 application
._elemdict
= {
302 'document' : document
,
305 character
._propdict
= {
309 character
._elemdict
= {
311 document
._propdict
= {
315 'location' : location
,
316 'file_permissions' : file_permissions
,
319 document
._elemdict
= {
325 insertion_point
._propdict
= {
329 insertion_point
._elemdict
= {
337 'character' : character
,
339 selection_2d_object
._propdict
= {
340 'contents' : contents
,
344 selection_2d_object
._elemdict
= {
345 'character' : character
,
354 'character' : character
,
355 'insertion_point' : insertion_point
,
363 'document' : document
,
364 'position' : position
,
370 import Metrowerks_Shell_Suite
371 from Metrowerks_Shell_Suite
import _Enum_savo
374 # Indices of types declared in this module
376 _classdeclarations
= {
378 'cins' : insertion_point
,
379 'capp' : application
,
381 'csel' : selection_2d_object
,
388 _propdeclarations
= {
400 'PERM' : file_permissions
,
403 'inte' : user_interaction
,
406 _compdeclarations
= {
409 _enumdeclarations
= {