Re: Handlers in list
Re: Handlers in list
- Subject: Re: Handlers in list
- From: "Neal A. Crocker" <email@hidden>
- Date: Sun, 22 Apr 2001 22:58:37 -0500
Sorry it this is a double post. The first time around, I used the
wrong subject line.
-----Original post below
Date: Sat, 21 Apr 2001 13:14:10 -0400
Subject: Handlers in list
From: "Stephen Swift (aka Burnum)" <email@hidden>
To: AppleScript <email@hidden>
<snip>
...but when I have
a list of handlers, all the handlers activate. I suppose I could use if
then statements if all else fails. Any Ideas? Thanks.
<snip>
set someList to {handler1(), handler2(), handler3(), handler4()}
This line actually executes each handler and puts the results in a list.
Instead, do this:
Code:
on RunHand() -- ********!!!!!!!!! this empty handler is important.
Don't neglect it.
end
set DlgResult to {null,null,null,null,null,null,false,true,false,false}
set someList to {handler1, handler2, handler3, handler4} --
********!!!!!!!!! This is different from your script
set Num to 1
repeat with i from 7 to 10
if item i of DlgResult = true then
set RunHand to item Num of someList
end if
set Num to Num + 1
end repeat
RunHand() -- ********!!!!!!!!! This is different from your script