summaryrefslogtreecommitdiffstats
path: root/Mac/Lib/lib-scripting/Finder_7_0_Suite.py
blob: 8d2f96b57caa5b03c79308c85b4620cf242d1ace (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
"""Suite 7.0 Finder Suite: This is the original Finder suite. These events will be supported in the future, but the syntax may be changed in a future Finder release.
Level 1, version 1

Generated from flap:System Folder:Finder
AETE/AEUT resource version 0/149, language 0, script 0
"""
# XXXX Hand edited to change the classname

import aetools
import MacOS

_code = 'FNDR'

class Finder_7_0_Suite:

	def open_about_box(self, _no_object=None, _attributes={}, **_arguments):
		"""open about box: Open the 'About This Mac' window
		Keyword argument _attributes: AppleEvent attribute dictionary
		"""
		_code = 'aevt'
		_subcode = 'abou'

		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.has_key('errn'):
			raise aetools.Error, aetools.decodeerror(_arguments)
		# XXXX Optionally decode result
		if _arguments.has_key('----'):
			return _arguments['----']

	_argmap_copy_to = {
		'_from' : 'fsel',
	}

	def copy_to(self, _object, _attributes={}, **_arguments):
		"""copy to: Copies one or more items into a folder
		Required argument: Alias for folder into which the items are copied
		Keyword argument _from: List of aliases for items to be copied
		Keyword argument _attributes: AppleEvent attribute dictionary
		"""
		_code = 'FNDR'
		_subcode = 'drag'

		aetools.keysubst(_arguments, self._argmap_copy_to)
		_arguments['----'] = _object


		_reply, _arguments, _attributes = self.send(_code, _subcode,
				_arguments, _attributes)
		if _arguments.has_key('errn'):
			raise aetools.Error, aetools.decodeerror(_arguments)
		# XXXX Optionally decode result
		if _arguments.has_key('----'):
			return _arguments['----']

	_argmap_duplicate = {
		'items' : 'fsel',
	}

	def duplicate(self, _object, _attributes={}, **_arguments):
		"""duplicate: Duplicate a set of items in a folder
		Required argument: Alias for folder containing the items
		Keyword argument items: List of aliases for items in the folder
		Keyword argument _attributes: AppleEvent attribute dictionary
		"""
		_code = 'FNDR'
		_subcode = 'sdup'

		aetools.keysubst(_arguments, self._argmap_duplicate)
		_arguments['----'] = _object


		_reply, _arguments, _attributes = self.send(_code, _subcode,
				_arguments, _attributes)
		if _arguments.has_key('errn'):
			raise aetools.Error, aetools.decodeerror(_arguments)
		# XXXX Optionally decode result
		if _arguments.has_key('----'):
			return _arguments['----']

	def empty_trash(self, _no_object=None, _attributes={}, **_arguments):
		"""empty trash: Empties the trash
		Keyword argument _attributes: AppleEvent attribute dictionary
		"""
		_code = 'FNDR'
		_subcode = 'empt'

		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.has_key('errn'):
			raise aetools.Error, aetools.decodeerror(_arguments)
		# XXXX Optionally decode result
		if _arguments.has_key('----'):
			return _arguments['----']

	_argmap_make_aliases_for = {
		'items' : 'fsel',
	}

	def make_aliases_for(self, _object, _attributes={}, **_arguments):
		"""make aliases for: Make aliases to items from a single folder
		Required argument: Alias for folder containing the items
		Keyword argument items: List of aliases for items in folder
		Keyword argument _attributes: AppleEvent attribute dictionary
		"""
		_code = 'FNDR'
		_subcode = 'sali'

		aetools.keysubst(_arguments, self._argmap_make_aliases_for)
		_arguments['----'] = _object


		_reply, _arguments, _attributes = self.send(_code, _subcode,
				_arguments, _attributes)
		if _arguments.has_key('errn'):
			raise aetools.Error, aetools.decodeerror(_arguments)
		# XXXX Optionally decode result
		if _arguments.has_key('----'):
			return _arguments['----']

	_argmap_move_to = {
		'_from' : 'fsel',
	}

	def move_to(self, _object, _attributes={}, **_arguments):
		"""move to: Move one or more items into a folder
		Required argument: Alias for destination folder
		Keyword argument _from: List of aliases for items to be moved 
		Keyword argument _attributes: AppleEvent attribute dictionary
		"""
		_code = 'FNDR'
		_subcode = 'move'

		aetools.keysubst(_arguments, self._argmap_move_to)
		_arguments['----'] = _object


		_reply, _arguments, _attributes = self.send(_code, _subcode,
				_arguments, _attributes)
		if _arguments.has_key('errn'):
			raise aetools.Error, aetools.decodeerror(_arguments)
		# XXXX Optionally decode result
		if _arguments.has_key('----'):
			return _arguments['----']

	def sleep(self, _no_object=None, _attributes={}, **_arguments):
		"""sleep: Put portable into sleep mode
		Keyword argument _attributes: AppleEvent attribute dictionary
		"""
		_code = 'FNDR'
		_subcode = 'slep'

		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.has_key('errn'):
			raise aetools.Error, aetools.decodeerror(_arguments)
		# XXXX Optionally decode result
		if _arguments.has_key('----'):
			return _arguments['----']

	def shut_down(self, _no_object=None, _attributes={}, **_arguments):
		"""shut down: Shuts down the Macintosh if all applications can quit
		Keyword argument _attributes: AppleEvent attribute dictionary
		"""
		_code = 'FNDR'
		_subcode = 'shut'

		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.has_key('errn'):
			raise aetools.Error, aetools.decodeerror(_arguments)
		# XXXX Optionally decode result
		if _arguments.has_key('----'):
			return _arguments['----']

	_argmap_open = {
		'items' : 'fsel',
	}

	def open(self, _object, _attributes={}, **_arguments):
		"""open: Open folders, files, or applications from a given folder
		Required argument: Alias for folder containing the items
		Keyword argument items: List of aliases for items in the folder
		Keyword argument _attributes: AppleEvent attribute dictionary
		"""
		_code = 'FNDR'
		_subcode = 'sope'

		aetools.keysubst(_arguments, self._argmap_open)
		_arguments['----'] = _object


		_reply, _arguments, _attributes = self.send(_code, _subcode,
				_arguments, _attributes)
		if _arguments.has_key('errn'):
			raise aetools.Error, aetools.decodeerror(_arguments)
		# XXXX Optionally decode result
		if _arguments.has_key('----'):
			return _arguments['----']

	_argmap__print = {
		'items' : 'fsel',
	}

	def _print(self, _object, _attributes={}, **_arguments):
		"""print: Print items from a given folder
		Required argument: Alias for folder containing the items
		Keyword argument items: List of aliases for items in folder
		Keyword argument _attributes: AppleEvent attribute dictionary
		"""
		_code = 'FNDR'
		_subcode = 'spri'

		aetools.keysubst(_arguments, self._argmap__print)
		_arguments['----'] = _object


		_reply, _arguments, _attributes = self.send(_code, _subcode,
				_arguments, _attributes)
		if _arguments.has_key('errn'):
			raise aetools.Error, aetools.decodeerror(_arguments)
		# XXXX Optionally decode result
		if _arguments.has_key('----'):
			return _arguments['----']

	_argmap_put_away = {
		'items' : 'fsel',
	}

	def put_away(self, _object, _attributes={}, **_arguments):
		"""put away: Put away items from a given folder
		Required argument: Alias for folder containing the items
		Keyword argument items: List of aliases to items in folder
		Keyword argument _attributes: AppleEvent attribute dictionary
		Returns: undocumented, typecode 'alis'
		"""
		_code = 'FNDR'
		_subcode = 'sput'

		aetools.keysubst(_arguments, self._argmap_put_away)
		_arguments['----'] = _object


		_reply, _arguments, _attributes = self.send(_code, _subcode,
				_arguments, _attributes)
		if _arguments.has_key('errn'):
			raise aetools.Error, aetools.decodeerror(_arguments)
		# XXXX Optionally decode result
		if _arguments.has_key('----'):
			return _arguments['----']

	def restart(self, _no_object=None, _attributes={}, **_arguments):
		"""restart: Restart the Macintosh
		Keyword argument _attributes: AppleEvent attribute dictionary
		"""
		_code = 'FNDR'
		_subcode = 'rest'

		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.has_key('errn'):
			raise aetools.Error, aetools.decodeerror(_arguments)
		# XXXX Optionally decode result
		if _arguments.has_key('----'):
			return _arguments['----']

	_argmap_select = {
		'items' : 'fsel',
	}

	def select(self, _object, _attributes={}, **_arguments):
		"""select: Select items in a folder
		Required argument: Alias for folder containing the items
		Keyword argument items: List of aliases for items in folder
		Keyword argument _attributes: AppleEvent attribute dictionary
		"""
		_code = 'FNDR'
		_subcode = 'srev'

		aetools.keysubst(_arguments, self._argmap_select)
		_arguments['----'] = _object


		_reply, _arguments, _attributes = self.send(_code, _subcode,
				_arguments, _attributes)
		if _arguments.has_key('errn'):
			raise aetools.Error, aetools.decodeerror(_arguments)
		# XXXX Optionally decode result
		if _arguments.has_key('----'):
			return _arguments['----']


#
# Indices of types declared in this module
#
_classdeclarations = {
}

_propdeclarations = {
}

_compdeclarations = {
}

_enumdeclarations = {
}