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: Mr Tea <email@hidden>
- Date: Tue, 13 Feb 2001 17:34:30 +0000
This from Maxime Paquette - dateline 2/13/01 3.48 pm:
>
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.
>
>
Any idea how I can do that?
You can use the 'keys pressed' command the free Jon's Additions scripting
addition, if it is practical to distribute this with your script.
It would allow you to use this repeat loop:
repeat until "Enter" is in (keys pressed)
end repeat
... at the point where you want your script to pause.
But (and it's a huge but - just like my wife's! *boom boom*) I don't know
how safe or efficient this would be. This type of repeat loop is quite
'processor intensive' - but you wouldn't want to put a significant delay in
it because the Enter key might get tapped during the delay.
Also, the Enter key does other important stuff in many apps, including the
Finder. You might want to choose a more 'neutral' key for users to press, if
this is an issue.
Cheers
Mr Tea
--
Brew of the day: whatever comes to hand...