Re: Stoping the script until "Enter" is pressed?
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