Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: creating a dictionary for an applescript app?



On 19 Jun 2007, at 22:23, tom wible wrote:

btw, the aem complication increases my motivation to rewrite the applescript...i only used a/s because ired & vdvhs are a/s-able, and appscript solves that problem;-)

aem's easy enough to use if you know a little bit about how Apple events work, and you can easily extend its Application class to call user-defined subroutines with positional parameters, e.g.:


#!/usr/local/bin/python

import aem

class Applet(aem.Application):
	def initwithname(klass, name):
		return klass(aem.findapp.byname(name))
	initwithname = classmethod(initwithname)

	def callsub(self, name, *args):
		self.event('ascrpsbr', {'snam': name, '----': args}).send()


playRec = Applet.initwithname('playRec') playRec.callsub('initRecList', False) recList = playRec.callsub('listRecDict')


Adding convenience methods for calling standard event handlers (run, reopen, quit, etc.) and extending callsub to support labelled parameters wouldn't be too hard if you want to make a general-purpose module out of it.


HTH

has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
http://appscript.sourceforge.net/objc-appscript.html

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >creating a dictionary for an applescript app? (From: tom wible <email@hidden>)
 >Re: creating a dictionary for an applescript app? (From: has <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.