• 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: Who rang?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Who rang?


  • Subject: Re: Who rang?
  • From: Stan Cleveland <email@hidden>
  • Date: Wed, 10 Mar 2010 17:57:24 -0800
  • Thread-topic: Who rang?

On 3/10/10 5:26 PM, "R. Nelson Byrne" wrote:

> Can a handler know who called it? If so, how?
>
> R. Nelson Byrne


Hi Nelson,

Not on its own. But if you're willing to send an identifier to the handler,
along with any other needed parameters, yes. Something like this:

on myHandler(numOne, numTwo, caller)
  if caller is "Bill" then
    return numOne * numTwo
  else
    return numOne + numTwo
  end if
end myHandler

myHandler(3, 5, "Mary")
--> 8
myHandler(3, 5, "Bill")
--> 15

HTH,
Stan C.


 _______________________________________________
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: 
 >Who rang? (From: "R. Nelson Byrne" <email@hidden>)

  • Prev by Date: Who rang?
  • Next by Date: Re: Replace cover page using applescript in Acrobat
  • Previous by thread: Who rang?
  • Next by thread: Osascripting
  • Index(es):
    • Date
    • Thread