Handlers in list
Handlers in list
- Subject: Handlers in list
- From: "Stephen Swift (aka Burnum)" <email@hidden>
- Date: Sat, 21 Apr 2001 13:14:10 -0400
Maybe handlers were never meant to go in a list, or maybe there is something
I just can't see.
My goal: There are four mini-scripts that my script could perform based on
my input in the main-script. To break up the script, I put each mini-script
in a handler. To choose the handler to run I used a repeat statement. The
repeat statement works fine when I use a list like {1,2,3,4} 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.
Code:
set DlgResult to {null,null,null,null,null,null,false,true,false,false}
set someList to {handler1(), handler2(), handler3(), handler4()}
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
BTW - Thanks for telling me about iDo. It did exactly what I wanted.
Stephen Swift ?' The Burnum Man
email@hidden
-----------------------------------------------
"Steve Jobs will use anybody to his own advantage. He will say one thing
and anybody who heard it would think that he was saying 'Maybe yes' or
'Maybe no.' You could never tell what he was thinking." -Steve Wozniak