• 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: calling handler with named parameters fails from script?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: calling handler with named parameters fails from script?


  • Subject: Re: calling handler with named parameters fails from script?
  • From: Timothy Bates <email@hidden>
  • Date: Sun, 01 Apr 2001 16:18:35 +1000

On 4/1/01 2:00 PM, "email@hidden" <email@hidden> wrote:
> I'd love to call one of my handlers like,
>
> remove "Dog" from myAnimals
>
> but I'm stuck with
>
> remove of "Dog" from myAnimals
>
> and I can't package that in a script object without the overloading of "of"
> causing trouble. So I get by with
>
> tell DoggeralCatcher to removal for "Dog" from myAnimals

I totally support this observation. It is the least readable element of
AppleScript, and fixing it would be a real boon to developing complex but
accessible scripts.
Scott's suggestion of making "of" an optional element when calling direct
parameters is excellent. This simple change fixes 80% of readability
problems for handlers with 2 parameters, and many of the problems with
handlers that are still more complex. however, I still vote for a parameter
name definition in the handler

remove the "dog" from animals of animalObject

on remove the animalName from myAnimals with parameter names{the, from}
--stuff
end

> maybe, if the handler were defined as,
> on hname given param1:val1, param2:val2, param3:val3
> it could be callable as
> hname param1 arg1 param2 arg2 param3 arg3

That would also be simple, and get us 80% of the way to a complete solution.

tim


  • Prev by Date: Where am I?
  • Next by Date: Re: CGIs with OSX
  • Previous by thread: calling handler with named parameters fails from script?
  • Next by thread: Re: is it possible to load a script library with a creation handler
  • Index(es):
    • Date
    • Thread