2000-08-20 16:29:03 -03:00
|
|
|
"""Suite Finder Basics: Commonly-used Finder commands and object classes
|
|
|
|
Level 1, version 1
|
|
|
|
|
2003-03-28 20:13:17 -04:00
|
|
|
Generated from /System/Library/CoreServices/Finder.app
|
2000-08-20 16:29:03 -03:00
|
|
|
AETE/AEUT resource version 0/144, language 0, script 0
|
|
|
|
"""
|
|
|
|
|
|
|
|
import aetools
|
|
|
|
import MacOS
|
|
|
|
|
|
|
|
_code = 'fndr'
|
|
|
|
|
|
|
|
class Finder_Basics_Events:
|
|
|
|
|
2003-04-12 19:27:11 -03:00
|
|
|
def copy(self, _no_object=None, _attributes={}, **_arguments):
|
|
|
|
"""copy: (NOT AVAILABLE YET) Copy the selected items to the clipboard (the Finder must be the front application)
|
|
|
|
Keyword argument _attributes: AppleEvent attribute dictionary
|
|
|
|
"""
|
|
|
|
_code = 'misc'
|
|
|
|
_subcode = 'copy'
|
|
|
|
|
|
|
|
if _arguments: raise TypeError, 'No optional args expected'
|
|
|
|
if _no_object != None: raise TypeError, 'No direct arg expected'
|
|
|
|
|
|
|
|
|
|
|
|
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
|
|
|
_arguments, _attributes)
|
|
|
|
if _arguments.get('errn', 0):
|
|
|
|
raise aetools.Error, aetools.decodeerror(_arguments)
|
|
|
|
# XXXX Optionally decode result
|
|
|
|
if _arguments.has_key('----'):
|
|
|
|
return _arguments['----']
|
|
|
|
|
|
|
|
_argmap_sort = {
|
|
|
|
'by' : 'by ',
|
|
|
|
}
|
|
|
|
|
|
|
|
def sort(self, _object, _attributes={}, **_arguments):
|
|
|
|
"""sort: (NOT AVAILABLE YET) Return the specified object(s) in a sorted list
|
|
|
|
Required argument: a list of finder objects to sort
|
|
|
|
Keyword argument by: the property to sort the items by (name, index, date, etc.)
|
|
|
|
Keyword argument _attributes: AppleEvent attribute dictionary
|
|
|
|
Returns: the sorted items in their new order
|
|
|
|
"""
|
|
|
|
_code = 'DATA'
|
|
|
|
_subcode = 'SORT'
|
|
|
|
|
|
|
|
aetools.keysubst(_arguments, self._argmap_sort)
|
|
|
|
_arguments['----'] = _object
|
|
|
|
|
|
|
|
|
|
|
|
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
|
|
|
_arguments, _attributes)
|
|
|
|
if _arguments.get('errn', 0):
|
|
|
|
raise aetools.Error, aetools.decodeerror(_arguments)
|
|
|
|
# XXXX Optionally decode result
|
|
|
|
if _arguments.has_key('----'):
|
|
|
|
return _arguments['----']
|
2000-08-20 16:29:03 -03:00
|
|
|
|
|
|
|
|
|
|
|
class application(aetools.ComponentItem):
|
2003-04-12 19:27:11 -03:00
|
|
|
"""application - The Finder """
|
|
|
|
want = 'capp'
|
2003-04-01 18:05:14 -04:00
|
|
|
class _Prop_Finder_preferences(aetools.NProperty):
|
2003-04-12 19:27:11 -03:00
|
|
|
"""Finder preferences - (NOT AVAILABLE YET) Various preferences that apply to the Finder as a whole """
|
|
|
|
which = 'pfrp'
|
|
|
|
want = 'cprf'
|
2003-06-13 11:31:19 -03:00
|
|
|
Finder_preferences = _Prop_Finder_preferences()
|
2003-04-01 18:05:14 -04:00
|
|
|
class _Prop_clipboard(aetools.NProperty):
|
2003-04-12 19:27:11 -03:00
|
|
|
"""clipboard - (NOT AVAILABLE YET) the Finder\xd5s clipboard window """
|
|
|
|
which = 'pcli'
|
|
|
|
want = 'obj '
|
2003-06-13 11:31:19 -03:00
|
|
|
clipboard = _Prop_clipboard()
|
2003-04-01 18:05:14 -04:00
|
|
|
class _Prop_desktop(aetools.NProperty):
|
2003-04-12 19:27:11 -03:00
|
|
|
"""desktop - the desktop """
|
|
|
|
which = 'desk'
|
|
|
|
want = 'cdsk'
|
2003-06-13 11:31:19 -03:00
|
|
|
desktop = _Prop_desktop()
|
2003-04-01 18:05:14 -04:00
|
|
|
class _Prop_frontmost(aetools.NProperty):
|
2003-04-12 19:27:11 -03:00
|
|
|
"""frontmost - Is the Finder the frontmost process? """
|
|
|
|
which = 'pisf'
|
|
|
|
want = 'bool'
|
2003-06-13 11:31:19 -03:00
|
|
|
frontmost = _Prop_frontmost()
|
2003-04-01 18:05:14 -04:00
|
|
|
class _Prop_home(aetools.NProperty):
|
2003-04-12 19:27:11 -03:00
|
|
|
"""home - the home directory """
|
|
|
|
which = 'home'
|
|
|
|
want = 'cfol'
|
2003-06-13 11:31:19 -03:00
|
|
|
home = _Prop_home()
|
2003-04-01 18:05:14 -04:00
|
|
|
class _Prop_insertion_location(aetools.NProperty):
|
2003-04-12 19:27:11 -03:00
|
|
|
"""insertion location - the container in which a new folder would appear if \xd2New Folder\xd3 was selected """
|
|
|
|
which = 'pins'
|
|
|
|
want = 'obj '
|
2003-06-13 11:31:19 -03:00
|
|
|
insertion_location = _Prop_insertion_location()
|
2003-04-01 18:05:14 -04:00
|
|
|
class _Prop_name(aetools.NProperty):
|
2003-04-12 19:27:11 -03:00
|
|
|
"""name - the Finder\xd5s name """
|
|
|
|
which = 'pnam'
|
|
|
|
want = 'itxt'
|
2003-06-13 11:31:19 -03:00
|
|
|
name = _Prop_name()
|
2003-04-01 18:05:14 -04:00
|
|
|
class _Prop_product_version(aetools.NProperty):
|
2003-04-12 19:27:11 -03:00
|
|
|
"""product version - the version of the System software running on this computer """
|
|
|
|
which = 'ver2'
|
|
|
|
want = 'utxt'
|
2003-06-13 11:31:19 -03:00
|
|
|
product_version = _Prop_product_version()
|
2003-04-01 18:05:14 -04:00
|
|
|
class _Prop_selection(aetools.NProperty):
|
2003-04-12 19:27:11 -03:00
|
|
|
"""selection - the selection in the frontmost Finder window """
|
|
|
|
which = 'sele'
|
|
|
|
want = 'obj '
|
2003-06-13 11:31:19 -03:00
|
|
|
selection = _Prop_selection()
|
2003-04-01 18:05:14 -04:00
|
|
|
class _Prop_startup_disk(aetools.NProperty):
|
2003-04-12 19:27:11 -03:00
|
|
|
"""startup disk - the startup disk """
|
|
|
|
which = 'sdsk'
|
|
|
|
want = 'cdis'
|
2003-06-13 11:31:19 -03:00
|
|
|
startup_disk = _Prop_startup_disk()
|
2003-04-01 18:05:14 -04:00
|
|
|
class _Prop_trash(aetools.NProperty):
|
2003-04-12 19:27:11 -03:00
|
|
|
"""trash - the trash """
|
|
|
|
which = 'trsh'
|
|
|
|
want = 'ctrs'
|
2003-06-13 11:31:19 -03:00
|
|
|
trash = _Prop_trash()
|
2003-04-01 18:05:14 -04:00
|
|
|
class _Prop_version(aetools.NProperty):
|
2003-04-12 19:27:11 -03:00
|
|
|
"""version - the version of the Finder """
|
|
|
|
which = 'vers'
|
|
|
|
want = 'utxt'
|
2003-06-13 11:31:19 -03:00
|
|
|
version = _Prop_version()
|
2003-04-01 18:05:14 -04:00
|
|
|
class _Prop_visible(aetools.NProperty):
|
2003-04-12 19:27:11 -03:00
|
|
|
"""visible - Is the Finder\xd5s layer visible? """
|
|
|
|
which = 'pvis'
|
|
|
|
want = 'bool'
|
2003-06-13 11:31:19 -03:00
|
|
|
visible = _Prop_visible()
|
2000-08-20 16:29:03 -03:00
|
|
|
# element 'alia' as ['indx', 'name']
|
|
|
|
# element 'appf' as ['indx', 'name', 'ID ']
|
2003-03-28 20:13:17 -04:00
|
|
|
# element 'brow' as ['indx', 'ID ']
|
2003-03-28 19:38:00 -04:00
|
|
|
# element 'cdis' as ['indx', 'name', 'ID ']
|
|
|
|
# element 'cfol' as ['indx', 'name', 'ID ']
|
|
|
|
# element 'clpf' as ['indx', 'name']
|
2003-03-28 20:13:17 -04:00
|
|
|
# element 'cobj' as ['indx', 'rele', 'name', 'rang', 'test']
|
2003-03-28 19:38:00 -04:00
|
|
|
# element 'ctnr' as ['indx', 'name']
|
|
|
|
# element 'cwin' as ['indx', 'name']
|
2000-08-20 16:29:03 -03:00
|
|
|
# element 'docf' as ['indx', 'name']
|
2003-03-28 19:38:00 -04:00
|
|
|
# element 'file' as ['indx', 'name']
|
2000-08-20 16:29:03 -03:00
|
|
|
# element 'inlf' as ['indx', 'name']
|
2003-03-28 19:38:00 -04:00
|
|
|
# element 'lwnd' as ['indx', 'name']
|
2000-08-20 16:29:03 -03:00
|
|
|
# element 'pack' as ['indx', 'name']
|
2002-08-07 12:53:42 -03:00
|
|
|
application._superclassnames = []
|
2003-03-28 20:13:17 -04:00
|
|
|
import Files
|
2000-08-20 16:29:03 -03:00
|
|
|
import Window_classes
|
2003-03-28 20:13:17 -04:00
|
|
|
import Containers_and_folders
|
|
|
|
import Finder_items
|
2002-08-07 12:53:42 -03:00
|
|
|
application._privpropdict = {
|
2003-04-12 19:27:11 -03:00
|
|
|
'Finder_preferences' : _Prop_Finder_preferences,
|
|
|
|
'clipboard' : _Prop_clipboard,
|
|
|
|
'desktop' : _Prop_desktop,
|
|
|
|
'frontmost' : _Prop_frontmost,
|
|
|
|
'home' : _Prop_home,
|
|
|
|
'insertion_location' : _Prop_insertion_location,
|
|
|
|
'name' : _Prop_name,
|
|
|
|
'product_version' : _Prop_product_version,
|
|
|
|
'selection' : _Prop_selection,
|
|
|
|
'startup_disk' : _Prop_startup_disk,
|
|
|
|
'trash' : _Prop_trash,
|
|
|
|
'version' : _Prop_version,
|
|
|
|
'visible' : _Prop_visible,
|
2000-08-20 16:29:03 -03:00
|
|
|
}
|
2002-08-07 12:53:42 -03:00
|
|
|
application._privelemdict = {
|
2003-04-12 19:27:11 -03:00
|
|
|
'Finder_window' : Window_classes.Finder_window,
|
|
|
|
'alias_file' : Files.alias_file,
|
|
|
|
'application_file' : Files.application_file,
|
|
|
|
'clipping' : Files.clipping,
|
|
|
|
'clipping_window' : Window_classes.clipping_window,
|
|
|
|
'container' : Containers_and_folders.container,
|
|
|
|
'disk' : Containers_and_folders.disk,
|
|
|
|
'document_file' : Files.document_file,
|
|
|
|
'file' : Files.file,
|
|
|
|
'folder' : Containers_and_folders.folder,
|
|
|
|
'internet_location_file' : Files.internet_location_file,
|
|
|
|
'item' : Finder_items.item,
|
|
|
|
'package' : Files.package,
|
|
|
|
'window' : Window_classes.window,
|
2000-08-20 16:29:03 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Indices of types declared in this module
|
|
|
|
#
|
|
|
|
_classdeclarations = {
|
2003-04-12 19:27:11 -03:00
|
|
|
'capp' : application,
|
|
|
|
}
|
|
|
|
|
|
|
|
_propdeclarations = {
|
|
|
|
'desk' : _Prop_desktop,
|
|
|
|
'home' : _Prop_home,
|
|
|
|
'pcli' : _Prop_clipboard,
|
|
|
|
'pfrp' : _Prop_Finder_preferences,
|
|
|
|
'pins' : _Prop_insertion_location,
|
|
|
|
'pisf' : _Prop_frontmost,
|
|
|
|
'pnam' : _Prop_name,
|
|
|
|
'pvis' : _Prop_visible,
|
|
|
|
'sdsk' : _Prop_startup_disk,
|
|
|
|
'sele' : _Prop_selection,
|
|
|
|
'trsh' : _Prop_trash,
|
|
|
|
'ver2' : _Prop_product_version,
|
|
|
|
'vers' : _Prop_version,
|
|
|
|
}
|
|
|
|
|
|
|
|
_compdeclarations = {
|
|
|
|
}
|
|
|
|
|
|
|
|
_enumdeclarations = {
|
2000-08-20 16:29:03 -03:00
|
|
|
}
|