| 1 | n/a | """Suite Finder Basics: Commonly-used Finder commands and object classes |
|---|
| 2 | n/a | Level 1, version 1 |
|---|
| 3 | n/a | |
|---|
| 4 | n/a | Generated from /System/Library/CoreServices/Finder.app |
|---|
| 5 | n/a | AETE/AEUT resource version 0/144, language 0, script 0 |
|---|
| 6 | n/a | """ |
|---|
| 7 | n/a | |
|---|
| 8 | n/a | import aetools |
|---|
| 9 | n/a | import MacOS |
|---|
| 10 | n/a | |
|---|
| 11 | n/a | _code = 'fndr' |
|---|
| 12 | n/a | |
|---|
| 13 | n/a | class Finder_Basics_Events: |
|---|
| 14 | n/a | |
|---|
| 15 | n/a | def copy(self, _no_object=None, _attributes={}, **_arguments): |
|---|
| 16 | n/a | """copy: (NOT AVAILABLE YET) Copy the selected items to the clipboard (the Finder must be the front application) |
|---|
| 17 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 18 | n/a | """ |
|---|
| 19 | n/a | _code = 'misc' |
|---|
| 20 | n/a | _subcode = 'copy' |
|---|
| 21 | n/a | |
|---|
| 22 | n/a | if _arguments: raise TypeError, 'No optional args expected' |
|---|
| 23 | n/a | if _no_object is not None: raise TypeError, 'No direct arg expected' |
|---|
| 24 | n/a | |
|---|
| 25 | n/a | |
|---|
| 26 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 27 | n/a | _arguments, _attributes) |
|---|
| 28 | n/a | if _arguments.get('errn', 0): |
|---|
| 29 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 30 | n/a | # XXXX Optionally decode result |
|---|
| 31 | n/a | if _arguments.has_key('----'): |
|---|
| 32 | n/a | return _arguments['----'] |
|---|
| 33 | n/a | |
|---|
| 34 | n/a | _argmap_sort = { |
|---|
| 35 | n/a | 'by' : 'by ', |
|---|
| 36 | n/a | } |
|---|
| 37 | n/a | |
|---|
| 38 | n/a | def sort(self, _object, _attributes={}, **_arguments): |
|---|
| 39 | n/a | """sort: (NOT AVAILABLE YET) Return the specified object(s) in a sorted list |
|---|
| 40 | n/a | Required argument: a list of finder objects to sort |
|---|
| 41 | n/a | Keyword argument by: the property to sort the items by (name, index, date, etc.) |
|---|
| 42 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 43 | n/a | Returns: the sorted items in their new order |
|---|
| 44 | n/a | """ |
|---|
| 45 | n/a | _code = 'DATA' |
|---|
| 46 | n/a | _subcode = 'SORT' |
|---|
| 47 | n/a | |
|---|
| 48 | n/a | aetools.keysubst(_arguments, self._argmap_sort) |
|---|
| 49 | n/a | _arguments['----'] = _object |
|---|
| 50 | n/a | |
|---|
| 51 | n/a | |
|---|
| 52 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 53 | n/a | _arguments, _attributes) |
|---|
| 54 | n/a | if _arguments.get('errn', 0): |
|---|
| 55 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 56 | n/a | # XXXX Optionally decode result |
|---|
| 57 | n/a | if _arguments.has_key('----'): |
|---|
| 58 | n/a | return _arguments['----'] |
|---|
| 59 | n/a | |
|---|
| 60 | n/a | |
|---|
| 61 | n/a | class application(aetools.ComponentItem): |
|---|
| 62 | n/a | """application - The Finder """ |
|---|
| 63 | n/a | want = 'capp' |
|---|
| 64 | n/a | class _Prop_Finder_preferences(aetools.NProperty): |
|---|
| 65 | n/a | """Finder preferences - (NOT AVAILABLE YET) Various preferences that apply to the Finder as a whole """ |
|---|
| 66 | n/a | which = 'pfrp' |
|---|
| 67 | n/a | want = 'cprf' |
|---|
| 68 | n/a | Finder_preferences = _Prop_Finder_preferences() |
|---|
| 69 | n/a | class _Prop_clipboard(aetools.NProperty): |
|---|
| 70 | n/a | """clipboard - (NOT AVAILABLE YET) the Finder\xd5s clipboard window """ |
|---|
| 71 | n/a | which = 'pcli' |
|---|
| 72 | n/a | want = 'obj ' |
|---|
| 73 | n/a | clipboard = _Prop_clipboard() |
|---|
| 74 | n/a | class _Prop_desktop(aetools.NProperty): |
|---|
| 75 | n/a | """desktop - the desktop """ |
|---|
| 76 | n/a | which = 'desk' |
|---|
| 77 | n/a | want = 'cdsk' |
|---|
| 78 | n/a | desktop = _Prop_desktop() |
|---|
| 79 | n/a | class _Prop_frontmost(aetools.NProperty): |
|---|
| 80 | n/a | """frontmost - Is the Finder the frontmost process? """ |
|---|
| 81 | n/a | which = 'pisf' |
|---|
| 82 | n/a | want = 'bool' |
|---|
| 83 | n/a | frontmost = _Prop_frontmost() |
|---|
| 84 | n/a | class _Prop_home(aetools.NProperty): |
|---|
| 85 | n/a | """home - the home directory """ |
|---|
| 86 | n/a | which = 'home' |
|---|
| 87 | n/a | want = 'cfol' |
|---|
| 88 | n/a | home = _Prop_home() |
|---|
| 89 | n/a | class _Prop_insertion_location(aetools.NProperty): |
|---|
| 90 | n/a | """insertion location - the container in which a new folder would appear if \xd2New Folder\xd3 was selected """ |
|---|
| 91 | n/a | which = 'pins' |
|---|
| 92 | n/a | want = 'obj ' |
|---|
| 93 | n/a | insertion_location = _Prop_insertion_location() |
|---|
| 94 | n/a | class _Prop_name(aetools.NProperty): |
|---|
| 95 | n/a | """name - the Finder\xd5s name """ |
|---|
| 96 | n/a | which = 'pnam' |
|---|
| 97 | n/a | want = 'itxt' |
|---|
| 98 | n/a | name = _Prop_name() |
|---|
| 99 | n/a | class _Prop_product_version(aetools.NProperty): |
|---|
| 100 | n/a | """product version - the version of the System software running on this computer """ |
|---|
| 101 | n/a | which = 'ver2' |
|---|
| 102 | n/a | want = 'utxt' |
|---|
| 103 | n/a | product_version = _Prop_product_version() |
|---|
| 104 | n/a | class _Prop_selection(aetools.NProperty): |
|---|
| 105 | n/a | """selection - the selection in the frontmost Finder window """ |
|---|
| 106 | n/a | which = 'sele' |
|---|
| 107 | n/a | want = 'obj ' |
|---|
| 108 | n/a | selection = _Prop_selection() |
|---|
| 109 | n/a | class _Prop_startup_disk(aetools.NProperty): |
|---|
| 110 | n/a | """startup disk - the startup disk """ |
|---|
| 111 | n/a | which = 'sdsk' |
|---|
| 112 | n/a | want = 'cdis' |
|---|
| 113 | n/a | startup_disk = _Prop_startup_disk() |
|---|
| 114 | n/a | class _Prop_trash(aetools.NProperty): |
|---|
| 115 | n/a | """trash - the trash """ |
|---|
| 116 | n/a | which = 'trsh' |
|---|
| 117 | n/a | want = 'ctrs' |
|---|
| 118 | n/a | trash = _Prop_trash() |
|---|
| 119 | n/a | class _Prop_version(aetools.NProperty): |
|---|
| 120 | n/a | """version - the version of the Finder """ |
|---|
| 121 | n/a | which = 'vers' |
|---|
| 122 | n/a | want = 'utxt' |
|---|
| 123 | n/a | version = _Prop_version() |
|---|
| 124 | n/a | class _Prop_visible(aetools.NProperty): |
|---|
| 125 | n/a | """visible - Is the Finder\xd5s layer visible? """ |
|---|
| 126 | n/a | which = 'pvis' |
|---|
| 127 | n/a | want = 'bool' |
|---|
| 128 | n/a | visible = _Prop_visible() |
|---|
| 129 | n/a | # element 'alia' as ['indx', 'name'] |
|---|
| 130 | n/a | # element 'appf' as ['indx', 'name', 'ID '] |
|---|
| 131 | n/a | # element 'brow' as ['indx', 'ID '] |
|---|
| 132 | n/a | # element 'cdis' as ['indx', 'name', 'ID '] |
|---|
| 133 | n/a | # element 'cfol' as ['indx', 'name', 'ID '] |
|---|
| 134 | n/a | # element 'clpf' as ['indx', 'name'] |
|---|
| 135 | n/a | # element 'cobj' as ['indx', 'rele', 'name', 'rang', 'test'] |
|---|
| 136 | n/a | # element 'ctnr' as ['indx', 'name'] |
|---|
| 137 | n/a | # element 'cwin' as ['indx', 'name'] |
|---|
| 138 | n/a | # element 'docf' as ['indx', 'name'] |
|---|
| 139 | n/a | # element 'file' as ['indx', 'name'] |
|---|
| 140 | n/a | # element 'inlf' as ['indx', 'name'] |
|---|
| 141 | n/a | # element 'lwnd' as ['indx', 'name'] |
|---|
| 142 | n/a | # element 'pack' as ['indx', 'name'] |
|---|
| 143 | n/a | application._superclassnames = [] |
|---|
| 144 | n/a | import Files |
|---|
| 145 | n/a | import Window_classes |
|---|
| 146 | n/a | import Containers_and_folders |
|---|
| 147 | n/a | import Finder_items |
|---|
| 148 | n/a | application._privpropdict = { |
|---|
| 149 | n/a | 'Finder_preferences' : _Prop_Finder_preferences, |
|---|
| 150 | n/a | 'clipboard' : _Prop_clipboard, |
|---|
| 151 | n/a | 'desktop' : _Prop_desktop, |
|---|
| 152 | n/a | 'frontmost' : _Prop_frontmost, |
|---|
| 153 | n/a | 'home' : _Prop_home, |
|---|
| 154 | n/a | 'insertion_location' : _Prop_insertion_location, |
|---|
| 155 | n/a | 'name' : _Prop_name, |
|---|
| 156 | n/a | 'product_version' : _Prop_product_version, |
|---|
| 157 | n/a | 'selection' : _Prop_selection, |
|---|
| 158 | n/a | 'startup_disk' : _Prop_startup_disk, |
|---|
| 159 | n/a | 'trash' : _Prop_trash, |
|---|
| 160 | n/a | 'version' : _Prop_version, |
|---|
| 161 | n/a | 'visible' : _Prop_visible, |
|---|
| 162 | n/a | } |
|---|
| 163 | n/a | application._privelemdict = { |
|---|
| 164 | n/a | 'Finder_window' : Window_classes.Finder_window, |
|---|
| 165 | n/a | 'alias_file' : Files.alias_file, |
|---|
| 166 | n/a | 'application_file' : Files.application_file, |
|---|
| 167 | n/a | 'clipping' : Files.clipping, |
|---|
| 168 | n/a | 'clipping_window' : Window_classes.clipping_window, |
|---|
| 169 | n/a | 'container' : Containers_and_folders.container, |
|---|
| 170 | n/a | 'disk' : Containers_and_folders.disk, |
|---|
| 171 | n/a | 'document_file' : Files.document_file, |
|---|
| 172 | n/a | 'file' : Files.file, |
|---|
| 173 | n/a | 'folder' : Containers_and_folders.folder, |
|---|
| 174 | n/a | 'internet_location_file' : Files.internet_location_file, |
|---|
| 175 | n/a | 'item' : Finder_items.item, |
|---|
| 176 | n/a | 'package' : Files.package, |
|---|
| 177 | n/a | 'window' : Window_classes.window, |
|---|
| 178 | n/a | } |
|---|
| 179 | n/a | |
|---|
| 180 | n/a | # |
|---|
| 181 | n/a | # Indices of types declared in this module |
|---|
| 182 | n/a | # |
|---|
| 183 | n/a | _classdeclarations = { |
|---|
| 184 | n/a | 'capp' : application, |
|---|
| 185 | n/a | } |
|---|
| 186 | n/a | |
|---|
| 187 | n/a | _propdeclarations = { |
|---|
| 188 | n/a | 'desk' : _Prop_desktop, |
|---|
| 189 | n/a | 'home' : _Prop_home, |
|---|
| 190 | n/a | 'pcli' : _Prop_clipboard, |
|---|
| 191 | n/a | 'pfrp' : _Prop_Finder_preferences, |
|---|
| 192 | n/a | 'pins' : _Prop_insertion_location, |
|---|
| 193 | n/a | 'pisf' : _Prop_frontmost, |
|---|
| 194 | n/a | 'pnam' : _Prop_name, |
|---|
| 195 | n/a | 'pvis' : _Prop_visible, |
|---|
| 196 | n/a | 'sdsk' : _Prop_startup_disk, |
|---|
| 197 | n/a | 'sele' : _Prop_selection, |
|---|
| 198 | n/a | 'trsh' : _Prop_trash, |
|---|
| 199 | n/a | 'ver2' : _Prop_product_version, |
|---|
| 200 | n/a | 'vers' : _Prop_version, |
|---|
| 201 | n/a | } |
|---|
| 202 | n/a | |
|---|
| 203 | n/a | _compdeclarations = { |
|---|
| 204 | n/a | } |
|---|
| 205 | n/a | |
|---|
| 206 | n/a | _enumdeclarations = { |
|---|
| 207 | n/a | } |
|---|