• 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: Stoping the script until "Enter" is pressed?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stoping the script until "Enter" is pressed?


  • Subject: Re: Stoping the script until "Enter" is pressed?
  • From: Jolly Roger <email@hidden>
  • Date: Tue, 13 Feb 2001 11:08:04 -0600
  • Replyto: email@hidden

on 2/13/2001 9:48 AM, Maxime Paquette (email@hidden)
wrote:

> The problem, is that I don't know how to know that the "Enter" key, or
> any other key, have been pressed so that I can continue the script.

I would do it like this:

-- begin script
my WaitForKey(return)

on WaitForKey(char)
set keyPressed to false
repeat until keyPressed
set iState to input state
set keyPressed to (iState's keys down contains char)
end repeat
end WaitForKey
-- end script

Note: this may not work on older systems - I am not sure how far back the
"input state" command is supported.

HTH

JR


  • Follow-Ups:
    • Re: Stoping the script until "Enter" is pressed?
      • From: Emmanuel <email@hidden>
    • Re: Stoping the script until "Enter" is pressed?
      • From: Mr Tea <email@hidden>
References: 
 >Stoping the script until "Enter" is pressed? (From: "Maxime Paquette" <email@hidden>)

  • Prev by Date: Re: backup script
  • Next by Date: Re: backup script
  • Previous by thread: Re: Stoping the script until "Enter" is pressed?
  • Next by thread: Re: Stoping the script until "Enter" is pressed?
  • Index(es):
    • Date
    • Thread