Re: Regarding Handlers...
Re: Regarding Handlers...
- Subject: Re: Regarding Handlers...
- From: Jason Bourque <email@hidden>
- Date: Mon, 18 Dec 2000 19:42:55 -0500
>
I have two questions regarding handlers in general... Here goes.
>
>
Question #1
>
>
Can a handler call another handler during it's execution before returning
>
to the script that called it? like in the following:
>
>
script commands...
>
handler_a()
>
more script commands...
>
end script
>
>
on handler_a()
>
commands
>
handler_a1()
>
return()
>
end handler_a
>
>
on handler_a1()
>
commands
>
return()
>
end handler_a1
>
>
Question #2
>
>
Is it not possible to call a handler from within an if statement...
>
I have tried the following but keep getting errors from the compiler.
>
>
display dialog "What is your favorite color?" button {"Red", "Blue",
>
"Neither"}
>
default = 1
>
set someValue to text returned from result
>
if someValue = "Red" then
>
goToRedHandler()
>
else if someValue = "Blue" then
>
goToBlueHandler()
>
end if
>
>
Any comments?
>
>
Thanks in advance.
Yes and yes, just make sure that you call the handler by using the word my
in front of it, if it is in a tell block otherwise the script assumes it the
handler belongs to the script not the application of the tell block.
my goToRedHandler()--use in tell blocks
goToRedHandler()--use outside of tell blocks
Hope this helps
Jason Bourque