1 """Suite Finder Basics: Commonly-used Finder commands and object classes
4 Generated from /Volumes/Sap/System Folder/Finder
5 AETE/AEUT resource version 0/144, language 0, script 0
13 class Finder_Basics_Events
:
19 def computer(self
, _object
, _attributes
={}, **_arguments
):
20 """computer: Test attributes of this computer
21 Required argument: the attribute to test
22 Keyword argument has: test specific bits of response
23 Keyword argument _attributes: AppleEvent attribute dictionary
24 Returns: the result of the query
29 aetools
.keysubst(_arguments
, self
._argmap
_computer
)
30 _arguments
['----'] = _object
33 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
34 _arguments
, _attributes
)
35 if _arguments
.get('errn', 0):
36 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
37 # XXXX Optionally decode result
38 if _arguments
.has_key('----'):
39 return _arguments
['----']
41 def copy(self
, _no_object
=None, _attributes
={}, **_arguments
):
42 """copy: Copy the selected items to the clipboard (the Finder must be the front application)
43 Keyword argument _attributes: AppleEvent attribute dictionary
48 if _arguments
: raise TypeError, 'No optional args expected'
49 if _no_object
!= None: raise TypeError, 'No direct arg expected'
52 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
53 _arguments
, _attributes
)
54 if _arguments
.get('errn', 0):
55 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
56 # XXXX Optionally decode result
57 if _arguments
.has_key('----'):
58 return _arguments
['----']
60 def restart(self
, _no_object
=None, _attributes
={}, **_arguments
):
61 """restart: Restart the computer
62 Keyword argument _attributes: AppleEvent attribute dictionary
67 if _arguments
: raise TypeError, 'No optional args expected'
68 if _no_object
!= None: raise TypeError, 'No direct arg expected'
71 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
72 _arguments
, _attributes
)
73 if _arguments
.get('errn', 0):
74 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
75 # XXXX Optionally decode result
76 if _arguments
.has_key('----'):
77 return _arguments
['----']
79 def shut_down(self
, _no_object
=None, _attributes
={}, **_arguments
):
80 """shut down: Shut Down the computer
81 Keyword argument _attributes: AppleEvent attribute dictionary
86 if _arguments
: raise TypeError, 'No optional args expected'
87 if _no_object
!= None: raise TypeError, 'No direct arg expected'
90 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
91 _arguments
, _attributes
)
92 if _arguments
.get('errn', 0):
93 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
94 # XXXX Optionally decode result
95 if _arguments
.has_key('----'):
96 return _arguments
['----']
98 def sleep(self
, _no_object
=None, _attributes
={}, **_arguments
):
99 """sleep: Put the computer to sleep
100 Keyword argument _attributes: AppleEvent attribute dictionary
105 if _arguments
: raise TypeError, 'No optional args expected'
106 if _no_object
!= None: raise TypeError, 'No direct arg expected'
109 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
110 _arguments
, _attributes
)
111 if _arguments
.get('errn', 0):
112 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
113 # XXXX Optionally decode result
114 if _arguments
.has_key('----'):
115 return _arguments
['----']
121 def sort(self
, _object
, _attributes
={}, **_arguments
):
122 """sort: Return the specified object(s) in a sorted list
123 Required argument: a list of finder objects to sort
124 Keyword argument by: the property to sort the items by (name, index, date, etc.)
125 Keyword argument _attributes: AppleEvent attribute dictionary
126 Returns: the sorted items in their new order
131 aetools
.keysubst(_arguments
, self
._argmap
_sort
)
132 _arguments
['----'] = _object
135 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
136 _arguments
, _attributes
)
137 if _arguments
.get('errn', 0):
138 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
139 # XXXX Optionally decode result
140 if _arguments
.has_key('----'):
141 return _arguments
['----']
144 class application(aetools
.ComponentItem
):
145 """application - The Finder """
147 class clipboard(aetools
.NProperty
):
148 """clipboard - the Finder\xd5s clipboard window """
151 class largest_free_block(aetools
.NProperty
):
152 """largest free block - the largest free block of process memory available to launch an application """
155 class name(aetools
.NProperty
):
156 """name - the Finder\xd5s name """
159 class visible(aetools
.NProperty
):
160 """visible - Is the Finder\xd5s layer visible? """
163 class frontmost(aetools
.NProperty
):
164 """frontmost - Is the Finder the frontmost process? """
167 class selection(aetools
.NProperty
):
168 """selection - the selection visible to the user """
171 class insertion_location(aetools
.NProperty
):
172 """insertion location - the container in which a new folder would appear if \xd2New Folder\xd3 was selected """
175 class file_sharing(aetools
.NProperty
):
176 """file sharing - Is file sharing on? """
179 class sharing_starting_up(aetools
.NProperty
):
180 """sharing starting up - Is file sharing in the process of starting up? """
183 class product_version(aetools
.NProperty
):
184 """product version - the version of the System software running on this computer """
187 class version(aetools
.NProperty
):
188 """version - the version of the Finder """
191 class about_this_computer(aetools
.NProperty
):
192 """about this computer - the \xd2About this Computer\xd3 dialog and the list of running processes displayed in it """
195 class desktop(aetools
.NProperty
):
196 """desktop - the desktop """
199 class execution_state(aetools
.NProperty
):
200 """execution state - the current execution state of the Finder """
203 class Finder_preferences(aetools
.NProperty
):
204 """Finder preferences - Various preferences that apply to the Finder as a whole """
207 # element 'cobj' as ['indx', 'name']
208 # element 'ctnr' as ['indx', 'name']
209 # element 'sctr' as ['indx', 'name']
210 # element 'cdis' as ['indx', 'name', 'ID ']
211 # element 'cfol' as ['indx', 'name', 'ID ']
212 # element 'file' as ['indx', 'name']
213 # element 'alia' as ['indx', 'name']
214 # element 'appf' as ['indx', 'name', 'ID ']
215 # element 'docf' as ['indx', 'name']
216 # element 'fntf' as ['indx', 'name']
217 # element 'dafi' as ['indx', 'name']
218 # element 'inlf' as ['indx', 'name']
219 # element 'sndf' as ['indx', 'name']
220 # element 'clpf' as ['indx', 'name']
221 # element 'pack' as ['indx', 'name']
222 # element 'stcs' as ['indx', 'name']
223 # element 'fsut' as ['indx', 'name']
224 # element 'dsut' as ['indx', 'name']
225 # element 'prcs' as ['indx', 'name']
226 # element 'pcap' as ['indx', 'name']
227 # element 'pcda' as ['indx', 'name']
228 # element 'cwin' as ['indx', 'name']
229 # element 'cwnd' as ['indx', 'name']
230 # element 'iwnd' as ['indx', 'name']
231 # element 'vwnd' as ['indx', 'name']
232 # element 'lwnd' as ['indx', 'name']
233 # element 'dwnd' as ['indx', 'name']
235 class special_folders(aetools
.ComponentItem
):
236 """special folders - The special folders used by the Mac OS """
238 class system_folder(aetools
.NProperty
):
239 """system folder - the System folder """
242 class apple_menu_items_folder(aetools
.NProperty
):
243 """apple menu items folder - the special folder named \xd2Apple Menu Items,\xd3 the contents of which appear in the Apple menu """
246 class control_panels_folder(aetools
.NProperty
):
247 """control panels folder - the special folder named \xd2Control Panels\xd3 """
250 class extensions_folder(aetools
.NProperty
):
251 """extensions folder - the special folder named \xd2Extensions\xd3 """
254 class fonts_folder(aetools
.NProperty
):
255 """fonts folder - the special folder named \xd2Fonts\xd3 """
258 class preferences_folder(aetools
.NProperty
):
259 """preferences folder - the special folder named \xd2Preferences\xd3 """
262 class shutdown_items_folder(aetools
.NProperty
):
263 """shutdown items folder - the special folder named \xd2Shutdown Items\xd3 """
266 class startup_items_folder(aetools
.NProperty
):
267 """startup items folder - the special folder named \xd2Startup Items\xd3 """
270 class temporary_items_folder(aetools
.NProperty
):
271 """temporary items folder - the special folder named \xd2Temporary Items\xd3 (invisible) """
274 application
._superclassnames
= []
276 import Containers_and_folders
277 import Files_and_suitcases
278 import Process_classes
279 import Window_classes
280 application
._privpropdict
= {
281 'clipboard' : clipboard
,
282 'largest_free_block' : largest_free_block
,
285 'frontmost' : frontmost
,
286 'selection' : selection
,
287 'insertion_location' : insertion_location
,
288 'file_sharing' : file_sharing
,
289 'sharing_starting_up' : sharing_starting_up
,
290 'product_version' : product_version
,
292 'about_this_computer' : about_this_computer
,
294 'execution_state' : execution_state
,
295 'Finder_preferences' : Finder_preferences
,
297 application
._privelemdict
= {
298 'item' : Earlier_terms
.item
,
299 'container' : Containers_and_folders
.container
,
300 'sharable_container' : Earlier_terms
.sharable_container
,
301 'disk' : Containers_and_folders
.disk
,
302 'folder' : Containers_and_folders
.folder
,
303 'file' : Files_and_suitcases
.file,
304 'alias_file' : Files_and_suitcases
.alias_file
,
305 'application_file' : Earlier_terms
.application_file
,
306 'document_file' : Files_and_suitcases
.document_file
,
307 'font_file' : Files_and_suitcases
.font_file
,
308 'desk_accessory_file' : Files_and_suitcases
.desk_accessory_file
,
309 'internet_location' : Earlier_terms
.internet_location
,
310 'sound_file' : Files_and_suitcases
.sound_file
,
311 'clipping' : Files_and_suitcases
.clipping
,
312 'package' : Files_and_suitcases
.package
,
313 'suitcase' : Files_and_suitcases
.suitcase
,
314 'font_suitcase' : Files_and_suitcases
.font_suitcase
,
315 'accessory_suitcase' : Earlier_terms
.accessory_suitcase
,
316 'process' : Earlier_terms
.process
,
317 'application_process' : Process_classes
.application_process
,
318 'accessory_process' : Earlier_terms
.accessory_process
,
319 'window' : Earlier_terms
.window
,
320 'container_window' : Earlier_terms
.container_window
,
321 'information_window' : Earlier_terms
.information_window
,
322 'view_options_window' : Window_classes
.view_options_window
,
323 'clipping_window' : Window_classes
.clipping_window
,
324 'content_space' : Window_classes
.content_space
,
326 special_folders
._superclassnames
= []
327 special_folders
._privpropdict
= {
328 'system_folder' : system_folder
,
329 'apple_menu_items_folder' : apple_menu_items_folder
,
330 'control_panels_folder' : control_panels_folder
,
331 'extensions_folder' : extensions_folder
,
332 'fonts_folder' : fonts_folder
,
333 'preferences_folder' : preferences_folder
,
334 'shutdown_items_folder' : shutdown_items_folder
,
335 'startup_items_folder' : startup_items_folder
,
336 'temporary_items_folder' : temporary_items_folder
,
338 special_folders
._privelemdict
= {
342 # Indices of types declared in this module
344 _classdeclarations
= {
345 'capp' : application
,
346 'spfl' : special_folders
,
349 _propdeclarations
= {
351 'ver2' : product_version
,
352 'pfrp' : Finder_preferences
,
353 'exec' : execution_state
,
354 'pins' : insertion_location
,
355 'mfre' : largest_free_block
,
356 'fsup' : sharing_starting_up
,
358 'ctrl' : control_panels_folder
,
359 'macs' : system_folder
,
360 'font' : fonts_folder
,
361 'abbx' : about_this_computer
,
362 'shdf' : shutdown_items_folder
,
363 'temp' : temporary_items_folder
,
367 'pref' : preferences_folder
,
368 'strt' : startup_items_folder
,
370 'fshr' : file_sharing
,
372 'extn' : extensions_folder
,
373 'amnu' : apple_menu_items_folder
,
376 _compdeclarations
= {
379 _enumdeclarations
= {