Re: creating a dictionary for an applescript app?
Re: creating a dictionary for an applescript app?
- Subject: Re: creating a dictionary for an applescript app?
- From: has <email@hidden>
- Date: Wed, 20 Jun 2007 13:03:26 +0100
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:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden