| 1 | n/a | """Suite Finder items: Commands used with file system items, and basic item definition |
|---|
| 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_items_Events: |
|---|
| 14 | n/a | |
|---|
| 15 | n/a | def add_to_favorites(self, _object, _attributes={}, **_arguments): |
|---|
| 16 | n/a | """add to favorites: (NOT AVAILABLE YET) Add the items to the user\xd5s Favorites |
|---|
| 17 | n/a | Required argument: the items to add to the collection of Favorites |
|---|
| 18 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 19 | n/a | """ |
|---|
| 20 | n/a | _code = 'fndr' |
|---|
| 21 | n/a | _subcode = 'ffav' |
|---|
| 22 | n/a | |
|---|
| 23 | n/a | if _arguments: raise TypeError, 'No optional args expected' |
|---|
| 24 | n/a | _arguments['----'] = _object |
|---|
| 25 | n/a | |
|---|
| 26 | n/a | |
|---|
| 27 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 28 | n/a | _arguments, _attributes) |
|---|
| 29 | n/a | if _arguments.get('errn', 0): |
|---|
| 30 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 31 | n/a | # XXXX Optionally decode result |
|---|
| 32 | n/a | if _arguments.has_key('----'): |
|---|
| 33 | n/a | return _arguments['----'] |
|---|
| 34 | n/a | |
|---|
| 35 | n/a | _argmap_clean_up = { |
|---|
| 36 | n/a | 'by' : 'by ', |
|---|
| 37 | n/a | } |
|---|
| 38 | n/a | |
|---|
| 39 | n/a | def clean_up(self, _object, _attributes={}, **_arguments): |
|---|
| 40 | n/a | """clean up: (NOT AVAILABLE YET) Arrange items in window nicely (only applies to open windows in icon view that are not kept arranged) |
|---|
| 41 | n/a | Required argument: the window to clean up |
|---|
| 42 | n/a | Keyword argument by: the order in which to clean up the objects (name, index, date, etc.) |
|---|
| 43 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 44 | n/a | """ |
|---|
| 45 | n/a | _code = 'fndr' |
|---|
| 46 | n/a | _subcode = 'fclu' |
|---|
| 47 | n/a | |
|---|
| 48 | n/a | aetools.keysubst(_arguments, self._argmap_clean_up) |
|---|
| 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 | def eject(self, _object=None, _attributes={}, **_arguments): |
|---|
| 61 | n/a | """eject: Eject the specified disk(s) |
|---|
| 62 | n/a | Required argument: the disk(s) to eject |
|---|
| 63 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 64 | n/a | """ |
|---|
| 65 | n/a | _code = 'fndr' |
|---|
| 66 | n/a | _subcode = 'ejct' |
|---|
| 67 | n/a | |
|---|
| 68 | n/a | if _arguments: raise TypeError, 'No optional args expected' |
|---|
| 69 | n/a | _arguments['----'] = _object |
|---|
| 70 | n/a | |
|---|
| 71 | n/a | |
|---|
| 72 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 73 | n/a | _arguments, _attributes) |
|---|
| 74 | n/a | if _arguments.get('errn', 0): |
|---|
| 75 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 76 | n/a | # XXXX Optionally decode result |
|---|
| 77 | n/a | if _arguments.has_key('----'): |
|---|
| 78 | n/a | return _arguments['----'] |
|---|
| 79 | n/a | |
|---|
| 80 | n/a | def empty(self, _object=None, _attributes={}, **_arguments): |
|---|
| 81 | n/a | """empty: Empty the trash |
|---|
| 82 | n/a | Required argument: \xd2empty\xd3 and \xd2empty trash\xd3 both do the same thing |
|---|
| 83 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 84 | n/a | """ |
|---|
| 85 | n/a | _code = 'fndr' |
|---|
| 86 | n/a | _subcode = 'empt' |
|---|
| 87 | n/a | |
|---|
| 88 | n/a | if _arguments: raise TypeError, 'No optional args expected' |
|---|
| 89 | n/a | _arguments['----'] = _object |
|---|
| 90 | n/a | |
|---|
| 91 | n/a | |
|---|
| 92 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 93 | n/a | _arguments, _attributes) |
|---|
| 94 | n/a | if _arguments.get('errn', 0): |
|---|
| 95 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 96 | n/a | # XXXX Optionally decode result |
|---|
| 97 | n/a | if _arguments.has_key('----'): |
|---|
| 98 | n/a | return _arguments['----'] |
|---|
| 99 | n/a | |
|---|
| 100 | n/a | def erase(self, _object, _attributes={}, **_arguments): |
|---|
| 101 | n/a | """erase: (NOT AVAILABLE) Erase the specified disk(s) |
|---|
| 102 | n/a | Required argument: the items to erase |
|---|
| 103 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 104 | n/a | """ |
|---|
| 105 | n/a | _code = 'fndr' |
|---|
| 106 | n/a | _subcode = 'fera' |
|---|
| 107 | n/a | |
|---|
| 108 | n/a | if _arguments: raise TypeError, 'No optional args expected' |
|---|
| 109 | n/a | _arguments['----'] = _object |
|---|
| 110 | n/a | |
|---|
| 111 | n/a | |
|---|
| 112 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 113 | n/a | _arguments, _attributes) |
|---|
| 114 | n/a | if _arguments.get('errn', 0): |
|---|
| 115 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 116 | n/a | # XXXX Optionally decode result |
|---|
| 117 | n/a | if _arguments.has_key('----'): |
|---|
| 118 | n/a | return _arguments['----'] |
|---|
| 119 | n/a | |
|---|
| 120 | n/a | def reveal(self, _object, _attributes={}, **_arguments): |
|---|
| 121 | n/a | """reveal: Bring the specified object(s) into view |
|---|
| 122 | n/a | Required argument: the object to be made visible |
|---|
| 123 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 124 | n/a | """ |
|---|
| 125 | n/a | _code = 'misc' |
|---|
| 126 | n/a | _subcode = 'mvis' |
|---|
| 127 | n/a | |
|---|
| 128 | n/a | if _arguments: raise TypeError, 'No optional args expected' |
|---|
| 129 | n/a | _arguments['----'] = _object |
|---|
| 130 | n/a | |
|---|
| 131 | n/a | |
|---|
| 132 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 133 | n/a | _arguments, _attributes) |
|---|
| 134 | n/a | if _arguments.get('errn', 0): |
|---|
| 135 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 136 | n/a | # XXXX Optionally decode result |
|---|
| 137 | n/a | if _arguments.has_key('----'): |
|---|
| 138 | n/a | return _arguments['----'] |
|---|
| 139 | n/a | |
|---|
| 140 | n/a | _argmap_update = { |
|---|
| 141 | n/a | 'necessity' : 'nec?', |
|---|
| 142 | n/a | 'registering_applications' : 'reg?', |
|---|
| 143 | n/a | } |
|---|
| 144 | n/a | |
|---|
| 145 | n/a | def update(self, _object, _attributes={}, **_arguments): |
|---|
| 146 | n/a | """update: Update the display of the specified object(s) to match their on-disk representation |
|---|
| 147 | n/a | Required argument: the item to update |
|---|
| 148 | n/a | Keyword argument necessity: only update if necessary (i.e. a finder window is open). default is false |
|---|
| 149 | n/a | Keyword argument registering_applications: register applications. default is true |
|---|
| 150 | n/a | Keyword argument _attributes: AppleEvent attribute dictionary |
|---|
| 151 | n/a | """ |
|---|
| 152 | n/a | _code = 'fndr' |
|---|
| 153 | n/a | _subcode = 'fupd' |
|---|
| 154 | n/a | |
|---|
| 155 | n/a | aetools.keysubst(_arguments, self._argmap_update) |
|---|
| 156 | n/a | _arguments['----'] = _object |
|---|
| 157 | n/a | |
|---|
| 158 | n/a | |
|---|
| 159 | n/a | _reply, _arguments, _attributes = self.send(_code, _subcode, |
|---|
| 160 | n/a | _arguments, _attributes) |
|---|
| 161 | n/a | if _arguments.get('errn', 0): |
|---|
| 162 | n/a | raise aetools.Error, aetools.decodeerror(_arguments) |
|---|
| 163 | n/a | # XXXX Optionally decode result |
|---|
| 164 | n/a | if _arguments.has_key('----'): |
|---|
| 165 | n/a | return _arguments['----'] |
|---|
| 166 | n/a | |
|---|
| 167 | n/a | |
|---|
| 168 | n/a | class item(aetools.ComponentItem): |
|---|
| 169 | n/a | """item - An item """ |
|---|
| 170 | n/a | want = 'cobj' |
|---|
| 171 | n/a | class _Prop_bounds(aetools.NProperty): |
|---|
| 172 | n/a | """bounds - the bounding rectangle of the item (can only be set for an item in a window viewed as icons or buttons) """ |
|---|
| 173 | n/a | which = 'pbnd' |
|---|
| 174 | n/a | want = 'qdrt' |
|---|
| 175 | n/a | class _Prop_comment(aetools.NProperty): |
|---|
| 176 | n/a | """comment - the comment of the item, displayed in the \xd2Get Info\xd3 window """ |
|---|
| 177 | n/a | which = 'comt' |
|---|
| 178 | n/a | want = 'utxt' |
|---|
| 179 | n/a | class _Prop_container(aetools.NProperty): |
|---|
| 180 | n/a | """container - the container of the item """ |
|---|
| 181 | n/a | which = 'ctnr' |
|---|
| 182 | n/a | want = 'obj ' |
|---|
| 183 | n/a | class _Prop_creation_date(aetools.NProperty): |
|---|
| 184 | n/a | """creation date - the date on which the item was created """ |
|---|
| 185 | n/a | which = 'ascd' |
|---|
| 186 | n/a | want = 'ldt ' |
|---|
| 187 | n/a | class _Prop_description(aetools.NProperty): |
|---|
| 188 | n/a | """description - a description of the item """ |
|---|
| 189 | n/a | which = 'dscr' |
|---|
| 190 | n/a | want = 'utxt' |
|---|
| 191 | n/a | class _Prop_disk(aetools.NProperty): |
|---|
| 192 | n/a | """disk - the disk on which the item is stored """ |
|---|
| 193 | n/a | which = 'cdis' |
|---|
| 194 | n/a | want = 'obj ' |
|---|
| 195 | n/a | class _Prop_displayed_name(aetools.NProperty): |
|---|
| 196 | n/a | """displayed name - the user-visible name of the item """ |
|---|
| 197 | n/a | which = 'dnam' |
|---|
| 198 | n/a | want = 'utxt' |
|---|
| 199 | n/a | class _Prop_everyones_privileges(aetools.NProperty): |
|---|
| 200 | n/a | """everyones privileges - """ |
|---|
| 201 | n/a | which = 'gstp' |
|---|
| 202 | n/a | want = 'priv' |
|---|
| 203 | n/a | class _Prop_extension_hidden(aetools.NProperty): |
|---|
| 204 | n/a | """extension hidden - Is the item's extension hidden from the user? """ |
|---|
| 205 | n/a | which = 'hidx' |
|---|
| 206 | n/a | want = 'bool' |
|---|
| 207 | n/a | class _Prop_group(aetools.NProperty): |
|---|
| 208 | n/a | """group - the user or group that has special access to the container """ |
|---|
| 209 | n/a | which = 'sgrp' |
|---|
| 210 | n/a | want = 'utxt' |
|---|
| 211 | n/a | class _Prop_group_privileges(aetools.NProperty): |
|---|
| 212 | n/a | """group privileges - """ |
|---|
| 213 | n/a | which = 'gppr' |
|---|
| 214 | n/a | want = 'priv' |
|---|
| 215 | n/a | class _Prop_icon(aetools.NProperty): |
|---|
| 216 | n/a | """icon - the icon bitmap of the item """ |
|---|
| 217 | n/a | which = 'iimg' |
|---|
| 218 | n/a | want = 'ifam' |
|---|
| 219 | n/a | class _Prop_index(aetools.NProperty): |
|---|
| 220 | n/a | """index - the index in the front-to-back ordering within its container """ |
|---|
| 221 | n/a | which = 'pidx' |
|---|
| 222 | n/a | want = 'long' |
|---|
| 223 | n/a | class _Prop_information_window(aetools.NProperty): |
|---|
| 224 | n/a | """information window - the information window for the item """ |
|---|
| 225 | n/a | which = 'iwnd' |
|---|
| 226 | n/a | want = 'obj ' |
|---|
| 227 | n/a | class _Prop_kind(aetools.NProperty): |
|---|
| 228 | n/a | """kind - the kind of the item """ |
|---|
| 229 | n/a | which = 'kind' |
|---|
| 230 | n/a | want = 'utxt' |
|---|
| 231 | n/a | class _Prop_label_index(aetools.NProperty): |
|---|
| 232 | n/a | """label index - the label of the item """ |
|---|
| 233 | n/a | which = 'labi' |
|---|
| 234 | n/a | want = 'long' |
|---|
| 235 | n/a | class _Prop_locked(aetools.NProperty): |
|---|
| 236 | n/a | """locked - Is the file locked? """ |
|---|
| 237 | n/a | which = 'aslk' |
|---|
| 238 | n/a | want = 'bool' |
|---|
| 239 | n/a | class _Prop_modification_date(aetools.NProperty): |
|---|
| 240 | n/a | """modification date - the date on which the item was last modified """ |
|---|
| 241 | n/a | which = 'asmo' |
|---|
| 242 | n/a | want = 'ldt ' |
|---|
| 243 | n/a | class _Prop_name(aetools.NProperty): |
|---|
| 244 | n/a | """name - the name of the item """ |
|---|
| 245 | n/a | which = 'pnam' |
|---|
| 246 | n/a | want = 'utxt' |
|---|
| 247 | n/a | class _Prop_name_extension(aetools.NProperty): |
|---|
| 248 | n/a | """name extension - the name extension of the item (such as \xd2txt\xd3) """ |
|---|
| 249 | n/a | which = 'nmxt' |
|---|
| 250 | n/a | want = 'utxt' |
|---|
| 251 | n/a | class _Prop_owner(aetools.NProperty): |
|---|
| 252 | n/a | """owner - the user that owns the container """ |
|---|
| 253 | n/a | which = 'sown' |
|---|
| 254 | n/a | want = 'utxt' |
|---|
| 255 | n/a | class _Prop_owner_privileges(aetools.NProperty): |
|---|
| 256 | n/a | """owner privileges - """ |
|---|
| 257 | n/a | which = 'ownr' |
|---|
| 258 | n/a | want = 'priv' |
|---|
| 259 | n/a | class _Prop_physical_size(aetools.NProperty): |
|---|
| 260 | n/a | """physical size - the actual space used by the item on disk """ |
|---|
| 261 | n/a | which = 'phys' |
|---|
| 262 | n/a | want = 'comp' |
|---|
| 263 | n/a | class _Prop_position(aetools.NProperty): |
|---|
| 264 | n/a | """position - the position of the item within its parent window (can only be set for an item in a window viewed as icons or buttons) """ |
|---|
| 265 | n/a | which = 'posn' |
|---|
| 266 | n/a | want = 'QDpt' |
|---|
| 267 | n/a | class _Prop_properties(aetools.NProperty): |
|---|
| 268 | n/a | """properties - every property of an item """ |
|---|
| 269 | n/a | which = 'pALL' |
|---|
| 270 | n/a | want = 'reco' |
|---|
| 271 | n/a | class _Prop_size(aetools.NProperty): |
|---|
| 272 | n/a | """size - the logical size of the item """ |
|---|
| 273 | n/a | which = 'ptsz' |
|---|
| 274 | n/a | want = 'comp' |
|---|
| 275 | n/a | class _Prop_url(aetools.NProperty): |
|---|
| 276 | n/a | """url - the url of the item """ |
|---|
| 277 | n/a | which = 'pURL' |
|---|
| 278 | n/a | want = 'utxt' |
|---|
| 279 | n/a | |
|---|
| 280 | n/a | items = item |
|---|
| 281 | n/a | item._superclassnames = [] |
|---|
| 282 | n/a | item._privpropdict = { |
|---|
| 283 | n/a | 'bounds' : _Prop_bounds, |
|---|
| 284 | n/a | 'comment' : _Prop_comment, |
|---|
| 285 | n/a | 'container' : _Prop_container, |
|---|
| 286 | n/a | 'creation_date' : _Prop_creation_date, |
|---|
| 287 | n/a | 'description' : _Prop_description, |
|---|
| 288 | n/a | 'disk' : _Prop_disk, |
|---|
| 289 | n/a | 'displayed_name' : _Prop_displayed_name, |
|---|
| 290 | n/a | 'everyones_privileges' : _Prop_everyones_privileges, |
|---|
| 291 | n/a | 'extension_hidden' : _Prop_extension_hidden, |
|---|
| 292 | n/a | 'group' : _Prop_group, |
|---|
| 293 | n/a | 'group_privileges' : _Prop_group_privileges, |
|---|
| 294 | n/a | 'icon' : _Prop_icon, |
|---|
| 295 | n/a | 'index' : _Prop_index, |
|---|
| 296 | n/a | 'information_window' : _Prop_information_window, |
|---|
| 297 | n/a | 'kind' : _Prop_kind, |
|---|
| 298 | n/a | 'label_index' : _Prop_label_index, |
|---|
| 299 | n/a | 'locked' : _Prop_locked, |
|---|
| 300 | n/a | 'modification_date' : _Prop_modification_date, |
|---|
| 301 | n/a | 'name' : _Prop_name, |
|---|
| 302 | n/a | 'name_extension' : _Prop_name_extension, |
|---|
| 303 | n/a | 'owner' : _Prop_owner, |
|---|
| 304 | n/a | 'owner_privileges' : _Prop_owner_privileges, |
|---|
| 305 | n/a | 'physical_size' : _Prop_physical_size, |
|---|
| 306 | n/a | 'position' : _Prop_position, |
|---|
| 307 | n/a | 'properties' : _Prop_properties, |
|---|
| 308 | n/a | 'size' : _Prop_size, |
|---|
| 309 | n/a | 'url' : _Prop_url, |
|---|
| 310 | n/a | } |
|---|
| 311 | n/a | item._privelemdict = { |
|---|
| 312 | n/a | } |
|---|
| 313 | n/a | |
|---|
| 314 | n/a | # |
|---|
| 315 | n/a | # Indices of types declared in this module |
|---|
| 316 | n/a | # |
|---|
| 317 | n/a | _classdeclarations = { |
|---|
| 318 | n/a | 'cobj' : item, |
|---|
| 319 | n/a | } |
|---|
| 320 | n/a | |
|---|
| 321 | n/a | _propdeclarations = { |
|---|
| 322 | n/a | 'ascd' : _Prop_creation_date, |
|---|
| 323 | n/a | 'aslk' : _Prop_locked, |
|---|
| 324 | n/a | 'asmo' : _Prop_modification_date, |
|---|
| 325 | n/a | 'cdis' : _Prop_disk, |
|---|
| 326 | n/a | 'comt' : _Prop_comment, |
|---|
| 327 | n/a | 'ctnr' : _Prop_container, |
|---|
| 328 | n/a | 'dnam' : _Prop_displayed_name, |
|---|
| 329 | n/a | 'dscr' : _Prop_description, |
|---|
| 330 | n/a | 'gppr' : _Prop_group_privileges, |
|---|
| 331 | n/a | 'gstp' : _Prop_everyones_privileges, |
|---|
| 332 | n/a | 'hidx' : _Prop_extension_hidden, |
|---|
| 333 | n/a | 'iimg' : _Prop_icon, |
|---|
| 334 | n/a | 'iwnd' : _Prop_information_window, |
|---|
| 335 | n/a | 'kind' : _Prop_kind, |
|---|
| 336 | n/a | 'labi' : _Prop_label_index, |
|---|
| 337 | n/a | 'nmxt' : _Prop_name_extension, |
|---|
| 338 | n/a | 'ownr' : _Prop_owner_privileges, |
|---|
| 339 | n/a | 'pALL' : _Prop_properties, |
|---|
| 340 | n/a | 'pURL' : _Prop_url, |
|---|
| 341 | n/a | 'pbnd' : _Prop_bounds, |
|---|
| 342 | n/a | 'phys' : _Prop_physical_size, |
|---|
| 343 | n/a | 'pidx' : _Prop_index, |
|---|
| 344 | n/a | 'pnam' : _Prop_name, |
|---|
| 345 | n/a | 'posn' : _Prop_position, |
|---|
| 346 | n/a | 'ptsz' : _Prop_size, |
|---|
| 347 | n/a | 'sgrp' : _Prop_group, |
|---|
| 348 | n/a | 'sown' : _Prop_owner, |
|---|
| 349 | n/a | } |
|---|
| 350 | n/a | |
|---|
| 351 | n/a | _compdeclarations = { |
|---|
| 352 | n/a | } |
|---|
| 353 | n/a | |
|---|
| 354 | n/a | _enumdeclarations = { |
|---|
| 355 | n/a | } |
|---|