• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: creating a dictionary for an applescript app?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
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>)

  • Prev by Date: Re: satimage OSAX list folder problem
  • Next by Date: Re: Catch Deny from Keychain Permission Dialog?
  • Previous by thread: Re: creating a dictionary for an applescript app?
  • Next by thread: Re: [Pythonmac-SIG] creating a dictionary for an applescript app?
  • Index(es):
    • Date
    • Thread