Re: Stopping the script until "Enter" is pressed?
Re: Stopping the script until "Enter" is pressed?
- Subject: Re: Stopping the script until "Enter" is pressed?
- From: "Marc K. Myers" <email@hidden>
- Date: Tue, 13 Feb 2001 13:46:04 -0500
- Organization: [very little]
>
From: "Maxime Paquette" <email@hidden>
>
To: "AppleScript-users" <email@hidden>
>
Subject: Re: Stoping the script until "Enter" is pressed?
>
Date: Tue, 13 Feb 2001 11:48:21 -0500
>
>
Sorry if I didn't explain much on what I wanted, here's some precisions:
>
When the script "pause" it's because the user need to do something
>
manually (that the script can't do because it's never the same thing) and
>
after doing that, the user press "Enter" so that the script continue after
>
the changes made by the user. So I need the user to be able to go to other
>
application and I don't want any dialog box to shows up.
>
>
is it possible?
>
>
Thanks.
>
>
Maxime Paquette.
>
>
>
>
>
>display dialog "Press enter ..." buttons {"Enter"} default button ,
>
> "Enter" with icon note
>
>
>
>
>
>-- hcir
>
>mailto:email@hidden
>
>Made with a Mac!
>
>
>
>
>
>
>
>> Hi,
>
>> Here's what I wnat to do in my script:
>
>>
>
>> on run
>
>> -- here, the script do a couple of things.
>
>> ...
>
>> ...
>
>> -- here, the script pause until the key "Enter" is pressed
>
>> -- here, the script continue (after the "enter" key have been
>
>> pressed).
>
>> end run
>
>>
>
>> 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.
The easiest way to handle this would be to break your script up into two
scripts, one to be run before the user actions and the other to be run
after. You could pass information between the two scripts by writing it
to a text file in #1 and reading/deleting the text file in #2.
If the application involved in the user actions will be run and then
quit, you could used the Sleep Commands OSAX. When you reach the user
action point you'd say 'sleep until running application "theAppName"'
and then 'sleep while running application "theAppName"'. When the app
has been run and quit, your script would pick up again after the second
Sleep Commands call.
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[2/13/01 1:45:18 PM]