• 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: Handlers in list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handlers in list


  • Subject: Re: Handlers in list
  • From: Nigel Garvey <email@hidden>
  • Date: Sun, 22 Apr 2001 00:16:08 +0100

"Stephen Swift (aka Burnum)" wrote on Sat, 21 Apr 2001 13:14:10 -0400:

>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

global RunHand

set DlgResult to {null,null,null,null,null,null,false,true,false,false}
set someList to {handler1, handler2, handler3, handler4}
repeat with Num from 1 to 4
if item (Num + 6) of DlgResult = true then
set RunHand to item Num of someList
end if
end repeat
RunHand()

The way it's arranged, the script will only run the handler corresponding
to the last 'true' in DlgResult. If you want it to react to more than
one, put the RunHand() line *inside* the loop.

NG


  • Follow-Ups:
    • Non-modal information window showing progress?
      • From: Harald E Brandt <email@hidden>
  • Prev by Date: creator type of application file of every application process
  • Next by Date: Re: Best way to check for hour?
  • Previous by thread: Re: Handlers in list
  • Next by thread: Non-modal information window showing progress?
  • Index(es):
    • Date
    • Thread