Exemplo n.º 1
0
	def call(self, name, *args):
		""" Call the specified user-defined handler.
				
				name : str -- the handler's name (case-sensitive)
				args : anything -- arguments to pass to script, if any; see documentation for supported types
				Result : anything | None -- the script's return value, if any
			
			Notes:
			
			- The handler's name must be a user-defined identifier, not an AppleScript keyword; e.g. 'myCount' is acceptable; 'count' is not.
			
			- AppleScript will ignore excess arguments. Passing insufficient arguments will result in an error.
			
			- If execution fails, a ScriptError is raised.
		"""
		evt = self._newevent(kae.kASAppleScriptSuite, kae.kASPrepositionalSubroutine, args)
		evt.setDescriptor_forKeyword_(NSAppleEventDescriptor.descriptorWithString_(name), 
						fourcharcode(kae.keyASSubroutineName))
		return self._unpackresult(*self._script.executeAppleEvent_error_(evt, None))
Exemplo n.º 2
0
	def call(self, name, *args):
		""" Call the specified user-defined handler.
				
				name : str -- the handler's name (case-sensitive)
				args : anything -- arguments to pass to script, if any; see documentation for supported types
				Result : anything | None -- the script's return value, if any
			
			Notes:
			
			- The handler's name must be a user-defined identifier, not an AppleScript keyword; e.g. 'myCount' is acceptable; 'count' is not.
			
			- AppleScript will ignore excess arguments. Passing insufficient arguments will result in an error.
			
			- If execution fails, a ScriptError is raised.
		"""
		evt = self._newevent(kae.kASAppleScriptSuite, kae.kASPrepositionalSubroutine, args)
		evt.setDescriptor_forKeyword_(NSAppleEventDescriptor.descriptorWithString_(name), 
						fourcharcode(kae.keyASSubroutineName))
		return self._unpackresult(*self._script.executeAppleEvent_error_(evt, None))
Exemplo n.º 3
0
 def packstr(self, val):
     return NSAppleEventDescriptor.descriptorWithString_(val)
Exemplo n.º 4
0
	def packstr(self, val):
		return NSAppleEventDescriptor.descriptorWithString_(val)