1
"""Suite Folder Actions Suite: Terms and Events for controlling Folder Actions
4
Generated from /System/Library/CoreServices/System Events.app
5
AETE/AEUT resource version 1/0, language 0, script 0
13
class Folder_Actions_Suite_Events:
15
_argmap_attach_action_to = {
19
def attach_action_to(self, _object, _attributes={}, **_arguments):
20
"""attach action to: Attach an action to a folder
21
Required argument: the object for the command
22
Keyword argument using: a file containing the script to attach
23
Keyword argument _attributes: AppleEvent attribute dictionary
24
Returns: the reply for the command
29
aetools.keysubst(_arguments, self._argmap_attach_action_to)
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 attached_scripts(self, _object, _attributes={}, **_arguments):
42
"""attached scripts: List the actions attached to a folder
43
Required argument: the object for the command
44
Keyword argument _attributes: AppleEvent attribute dictionary
45
Returns: the reply for the command
50
if _arguments: raise TypeError, 'No optional args expected'
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['----']
62
_argmap_do_folder_action = {
63
'with_window_size' : 'fnsz',
64
'with_item_list' : 'flst',
65
'folder_action_code' : 'actn',
68
def do_folder_action(self, _object, _attributes={}, **_arguments):
69
"""do folder action: Event the Finder sends to the Folder Actions FBA
70
Required argument: the object for the command
71
Keyword argument with_window_size: the new window size for the folder action message to process
72
Keyword argument with_item_list: a list of items for the folder action message to process
73
Keyword argument folder_action_code: the folder action message to process
74
Keyword argument _attributes: AppleEvent attribute dictionary
75
Returns: the reply for the command
80
aetools.keysubst(_arguments, self._argmap_do_folder_action)
81
_arguments['----'] = _object
83
aetools.enumsubst(_arguments, 'actn', _Enum_actn)
85
_reply, _arguments, _attributes = self.send(_code, _subcode,
86
_arguments, _attributes)
87
if _arguments.get('errn', 0):
88
raise aetools.Error, aetools.decodeerror(_arguments)
89
# XXXX Optionally decode result
90
if _arguments.has_key('----'):
91
return _arguments['----']
93
_argmap_edit_action_of = {
94
'using_action_name' : 'snam',
95
'using_action_number' : 'indx',
98
def edit_action_of(self, _object, _attributes={}, **_arguments):
99
"""edit action of: Edit as action of a folder
100
Required argument: the object for the command
101
Keyword argument using_action_name: ...or the name of the action to edit
102
Keyword argument using_action_number: the index number of the action to edit...
103
Keyword argument _attributes: AppleEvent attribute dictionary
104
Returns: the reply for the command
109
aetools.keysubst(_arguments, self._argmap_edit_action_of)
110
_arguments['----'] = _object
113
_reply, _arguments, _attributes = self.send(_code, _subcode,
114
_arguments, _attributes)
115
if _arguments.get('errn', 0):
116
raise aetools.Error, aetools.decodeerror(_arguments)
117
# XXXX Optionally decode result
118
if _arguments.has_key('----'):
119
return _arguments['----']
121
_argmap_remove_action_from = {
122
'using_action_name' : 'snam',
123
'using_action_number' : 'indx',
126
def remove_action_from(self, _object, _attributes={}, **_arguments):
127
"""remove action from: Remove a folder action from a folder
128
Required argument: the object for the command
129
Keyword argument using_action_name: ...or the name of the action to remove
130
Keyword argument using_action_number: the index number of the action to remove...
131
Keyword argument _attributes: AppleEvent attribute dictionary
132
Returns: the reply for the command
137
aetools.keysubst(_arguments, self._argmap_remove_action_from)
138
_arguments['----'] = _object
141
_reply, _arguments, _attributes = self.send(_code, _subcode,
142
_arguments, _attributes)
143
if _arguments.get('errn', 0):
144
raise aetools.Error, aetools.decodeerror(_arguments)
145
# XXXX Optionally decode result
146
if _arguments.has_key('----'):
147
return _arguments['----']
150
class application(aetools.ComponentItem):
151
"""application - The Folder Actions Suite host program """
153
class _Prop__3c_Inheritance_3e_(aetools.NProperty):
154
"""<Inheritance> - All of the properties of the superclass. """
157
_3c_Inheritance_3e_ = _Prop__3c_Inheritance_3e_()
158
class _Prop_folder_actions_enabled(aetools.NProperty):
159
"""folder actions enabled - Are Folder Actions currently being processed? """
162
folder_actions_enabled = _Prop_folder_actions_enabled()
163
class _Prop_properties(aetools.NProperty):
164
"""properties - every property of the Folder Actions Suite host program """
167
properties = _Prop_properties()
168
# element 'cdis' as ['name', 'indx', 'rele', 'rang', 'test']
169
# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test']
170
# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test']
171
# element 'cwin' as ['name', 'indx', 'rele', 'rang', 'test', 'ID ']
172
# element 'docu' as ['name', 'indx', 'rele', 'rang', 'test']
173
# element 'file' as ['name', 'indx', 'rele', 'rang', 'test']
174
# element 'foac' as ['name', 'indx', 'rele', 'rang', 'test']
175
# element 'logi' as ['name', 'indx', 'rele', 'rang', 'test']
176
# element 'pcap' as ['name', 'indx', 'rele', 'rang', 'test']
177
# element 'pcda' as ['name', 'indx', 'rele', 'rang', 'test']
178
# element 'prcs' as ['name', 'indx', 'rele', 'rang', 'test']
180
applications = application
182
class folder_action(aetools.ComponentItem):
183
"""folder action - An action attached to a folder in the file system """
185
class _Prop_name(aetools.NProperty):
186
"""name - the name of the folder action, which is also the name of the folder """
189
class _Prop_path(aetools.NProperty):
190
"""path - the path to the folder to which the folder action applies """
193
class _Prop_volume(aetools.NProperty):
194
"""volume - the volume on which the folder action resides """
197
# element 'scpt' as ['name', 'indx', 'rele', 'rang', 'test']
199
folder_actions = folder_action
201
class script(aetools.ComponentItem):
202
"""script - A script invoked by a folder action """
204
class _Prop_POSIX_path(aetools.NProperty):
205
"""POSIX path - the POSIX file system path of the disk """
210
application._superclassnames = []
211
import Disk_Folder_File_Suite
212
import Standard_Suite
213
import Login_Items_Suite
214
import Processes_Suite
215
application._privpropdict = {
216
'_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_,
217
'folder_actions_enabled' : _Prop_folder_actions_enabled,
218
'properties' : _Prop_properties,
220
application._privelemdict = {
221
'application_process' : Processes_Suite.application_process,
222
'desk_accessory_process' : Processes_Suite.desk_accessory_process,
223
'disk' : Disk_Folder_File_Suite.disk,
224
'document' : Standard_Suite.document,
225
'file' : Disk_Folder_File_Suite.file,
226
'folder' : Disk_Folder_File_Suite.folder,
227
'folder_action' : folder_action,
228
'item' : Disk_Folder_File_Suite.item,
229
'login_item' : Login_Items_Suite.login_item,
230
'process' : Processes_Suite.process,
231
'window' : Standard_Suite.window,
233
folder_action._superclassnames = ['item']
234
folder_action._privpropdict = {
235
'_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_,
238
'properties' : _Prop_properties,
239
'volume' : _Prop_volume,
241
folder_action._privelemdict = {
244
script._superclassnames = ['item']
245
script._privpropdict = {
246
'POSIX_path' : _Prop_POSIX_path,
247
'_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_,
250
'properties' : _Prop_properties,
252
script._privelemdict = {
255
'items_added' : 'fget', # items added
256
'items_removed' : 'flos', # items removed
257
'window_closed' : 'fclo', # window closed
258
'window_moved' : 'fsiz', # window moved
259
'window_opened' : 'fopn', # window opened
264
# Indices of types declared in this module
266
_classdeclarations = {
267
'capp' : application,
268
'foac' : folder_action,
272
_propdeclarations = {
273
'c@#^' : _Prop__3c_Inheritance_3e_,
274
'faen' : _Prop_folder_actions_enabled,
275
'pALL' : _Prop_properties,
277
'posx' : _Prop_POSIX_path,
279
'volu' : _Prop_volume,
282
_compdeclarations = {
285
_enumdeclarations = {