1 """Suite Standard Suite: Common terms that most applications should support
4 Generated from /System/Library/CoreServices/Finder.app
5 AETE/AEUT resource version 0/144, language 0, script 0
13 from StdSuites
.Standard_Suite
import *
14 class Standard_Suite_Events(Standard_Suite_Events
):
16 def close(self
, _object
, _attributes
={}, **_arguments
):
17 """close: Close an object
18 Required argument: the object to close
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
['----']
40 def count(self
, _object
, _attributes
={}, **_arguments
):
41 """count: Return the number of elements of a particular class within an object
42 Required argument: the object whose elements are to be counted
43 Keyword argument each: the class of the elements to be counted
44 Keyword argument _attributes: AppleEvent attribute dictionary
45 Returns: the number of elements
50 aetools
.keysubst(_arguments
, self
._argmap
_count
)
51 _arguments
['----'] = _object
54 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
55 _arguments
, _attributes
)
56 if _arguments
.get('errn', 0):
57 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
58 # XXXX Optionally decode result
59 if _arguments
.has_key('----'):
60 return _arguments
['----']
66 def data_size(self
, _object
, _attributes
={}, **_arguments
):
67 """data size: Return the size in bytes of an object
68 Required argument: the object whose data size is to be returned
69 Keyword argument as: the data type for which the size is calculated
70 Keyword argument _attributes: AppleEvent attribute dictionary
71 Returns: the size of the object in bytes
76 aetools
.keysubst(_arguments
, self
._argmap
_data
_size
)
77 _arguments
['----'] = _object
80 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
81 _arguments
, _attributes
)
82 if _arguments
.get('errn', 0):
83 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
84 # XXXX Optionally decode result
85 if _arguments
.has_key('----'):
86 return _arguments
['----']
88 def delete(self
, _object
, _attributes
={}, **_arguments
):
89 """delete: Move an item from its container to the trash
90 Required argument: the item to delete
91 Keyword argument _attributes: AppleEvent attribute dictionary
92 Returns: to the item that was just deleted
97 if _arguments
: raise TypeError, 'No optional args expected'
98 _arguments
['----'] = _object
101 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
102 _arguments
, _attributes
)
103 if _arguments
.get('errn', 0):
104 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
105 # XXXX Optionally decode result
106 if _arguments
.has_key('----'):
107 return _arguments
['----']
109 _argmap_duplicate
= {
111 'replacing' : 'alrp',
112 'routing_suppressed' : 'rout',
115 def duplicate(self
, _object
, _attributes
={}, **_arguments
):
116 """duplicate: Duplicate one or more object(s)
117 Required argument: the object(s) to duplicate
118 Keyword argument to: the new location for the object(s)
119 Keyword argument replacing: Specifies whether or not to replace items in the destination that have the same name as items being duplicated
120 Keyword argument routing_suppressed: Specifies whether or not to autoroute items (default is false). Only applies when copying to the system folder.
121 Keyword argument _attributes: AppleEvent attribute dictionary
122 Returns: to the duplicated object(s)
127 aetools
.keysubst(_arguments
, self
._argmap
_duplicate
)
128 _arguments
['----'] = _object
130 aetools
.enumsubst(_arguments
, 'alrp', _Enum_bool
)
131 aetools
.enumsubst(_arguments
, 'rout', _Enum_bool
)
133 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
134 _arguments
, _attributes
)
135 if _arguments
.get('errn', 0):
136 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
137 # XXXX Optionally decode result
138 if _arguments
.has_key('----'):
139 return _arguments
['----']
141 def exists(self
, _object
, _attributes
={}, **_arguments
):
142 """exists: Verify if an object exists
143 Required argument: the object in question
144 Keyword argument _attributes: AppleEvent attribute dictionary
145 Returns: true if it exists, false if not
150 if _arguments
: raise TypeError, 'No optional args expected'
151 _arguments
['----'] = _object
154 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
155 _arguments
, _attributes
)
156 if _arguments
.get('errn', 0):
157 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
158 # XXXX Optionally decode result
159 if _arguments
.has_key('----'):
160 return _arguments
['----']
166 'with_properties' : 'prdt',
169 def make(self
, _no_object
=None, _attributes
={}, **_arguments
):
170 """make: Make a new element
171 Keyword argument new: the class of the new element
172 Keyword argument at: the location at which to insert the element
173 Keyword argument to: when creating an alias file, the original item to create an alias to or when creating a file viewer window, the target of the window
174 Keyword argument with_properties: the initial values for the properties of the element
175 Keyword argument _attributes: AppleEvent attribute dictionary
176 Returns: to the new object(s)
181 aetools
.keysubst(_arguments
, self
._argmap
_make
)
182 if _no_object
is not None: raise TypeError, 'No direct arg expected'
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
['----']
195 'replacing' : 'alrp',
196 'positioned_at' : 'mvpl',
197 'routing_suppressed' : 'rout',
200 def move(self
, _object
, _attributes
={}, **_arguments
):
201 """move: Move object(s) to a new location
202 Required argument: the object(s) to move
203 Keyword argument to: the new location for the object(s)
204 Keyword argument replacing: Specifies whether or not to replace items in the destination that have the same name as items being moved
205 Keyword argument positioned_at: Gives a list (in local window coordinates) of positions for the destination items
206 Keyword argument routing_suppressed: Specifies whether or not to autoroute items (default is false). Only applies when moving to the system folder.
207 Keyword argument _attributes: AppleEvent attribute dictionary
208 Returns: to the object(s) after they have been moved
213 aetools
.keysubst(_arguments
, self
._argmap
_move
)
214 _arguments
['----'] = _object
216 aetools
.enumsubst(_arguments
, 'alrp', _Enum_bool
)
217 aetools
.enumsubst(_arguments
, 'mvpl', _Enum_list
)
218 aetools
.enumsubst(_arguments
, 'rout', _Enum_bool
)
220 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
221 _arguments
, _attributes
)
222 if _arguments
.get('errn', 0):
223 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
224 # XXXX Optionally decode result
225 if _arguments
.has_key('----'):
226 return _arguments
['----']
230 'with_properties' : 'prdt',
233 def open(self
, _object
, _attributes
={}, **_arguments
):
234 """open: Open the specified object(s)
235 Required argument: list of objects to open
236 Keyword argument using: the application file to open the object with
237 Keyword argument with_properties: the initial values for the properties, to be included with the open command sent to the application that opens the direct object
238 Keyword argument _attributes: AppleEvent attribute dictionary
243 aetools
.keysubst(_arguments
, self
._argmap
_open
)
244 _arguments
['----'] = _object
247 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
248 _arguments
, _attributes
)
249 if _arguments
.get('errn', 0):
250 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
251 # XXXX Optionally decode result
252 if _arguments
.has_key('----'):
253 return _arguments
['----']
256 'with_properties' : 'prdt',
259 def print_(self
, _object
, _attributes
={}, **_arguments
):
260 """print: Print the specified object(s)
261 Required argument: list of objects to print
262 Keyword argument with_properties: optional properties to be included with the print command sent to the application that prints the direct object
263 Keyword argument _attributes: AppleEvent attribute dictionary
268 aetools
.keysubst(_arguments
, self
._argmap
_print
_)
269 _arguments
['----'] = _object
272 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
273 _arguments
, _attributes
)
274 if _arguments
.get('errn', 0):
275 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
276 # XXXX Optionally decode result
277 if _arguments
.has_key('----'):
278 return _arguments
['----']
280 def quit(self
, _no_object
=None, _attributes
={}, **_arguments
):
281 """quit: Quit the Finder
282 Keyword argument _attributes: AppleEvent attribute dictionary
287 if _arguments
: raise TypeError, 'No optional args expected'
288 if _no_object
is not None: raise TypeError, 'No direct arg expected'
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
['----']
299 def select(self
, _object
, _attributes
={}, **_arguments
):
300 """select: Select the specified object(s)
301 Required argument: the object to select
302 Keyword argument _attributes: AppleEvent attribute dictionary
307 if _arguments
: raise TypeError, 'No optional args expected'
308 _arguments
['----'] = _object
311 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
312 _arguments
, _attributes
)
313 if _arguments
.get('errn', 0):
314 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
315 # XXXX Optionally decode result
316 if _arguments
.has_key('----'):
317 return _arguments
['----']
319 _Enum_list
= None # XXXX enum list not found!!
320 _Enum_bool
= None # XXXX enum bool not found!!
323 # Indices of types declared in this module
325 _classdeclarations
= {
328 _propdeclarations
= {
331 _compdeclarations
= {
334 _enumdeclarations
= {