Exemple #1
0
	def __init__(self):
		self.active = 0
		for suite in self.suites:
			AE.AEInstallEventHandler(suite, typeWildCard, self.aehandler)
		self.active = 1
		self.appleid = 1
		Menu.ClearMenuBar()
		self.applemenu = applemenu = Menu.NewMenu(self.appleid, "\024")
		applemenu.AppendMenu("All about echo...;(-")
		applemenu.AddResMenu('DRVR')
		applemenu.InsertMenu(0)
		Menu.DrawMenuBar()
Exemple #2
0
	print 'core event!'
	parameters, attributes = aetools.unpackevent(req)
	print "event class =", attributes['evcl']
	print "event id =", attributes['evid']
	print 'parameters:', parameters
	# echo the arguments, to see how Script Editor formats them
	aetools.packevent(rep, parameters)

def wildhandler(req, rep):
	print 'wildcard event!'
	parameters, attributes = aetools.unpackevent(req)
	print "event class =", attributes['evcl']
	print "event id =", attributes['evid']
	print 'parameters:', parameters

AE.AEInstallEventHandler(typeAppleEvent, kAEOpenApplication, aehandler)
AE.AEInstallEventHandler(typeAppleEvent, kAEOpenDocuments, aehandler)
AE.AEInstallEventHandler(typeAppleEvent, kAEPrintDocuments, aehandler)
AE.AEInstallEventHandler(typeAppleEvent, kAEQuitApplication, quithandler)
AE.AEInstallEventHandler(typeAppleEvent, typeWildCard, unihandler)
AE.AEInstallEventHandler('core', typeWildCard, corehandler)
#AE.AEInstallEventHandler(typeWildCard, typeWildCard, wildhandler)


def main():
	global quit
	quit = 0
	while not quit:
		ok, e = Evt.WaitNextEvent(-1, 60)
		if ok:
			print 'Event:', e