i want the script to work and while its working i want it to do something if a specific key or key combination is pressed.
I need the script to "wait" for the keystroke and at the same time keep working.
Can it be done?
Thanks.
wait for a keystroke
Moderators: Dorian (MJT support), JRL
CatBreath,
I think you can accomplish this by running multiple scripts. I know you can do it by running multiple compiled scripts (exe).
For example I have a user who has four exes running. All started by one exe. Each of the four "pastes" a different column from a csv file line when he presses either F9, F10, F11 or F12. The four exes look more or less like this:
Let>path=TEMP_DIR
Let>comma=,
Let>k=0
Label>start
Let>k=k+1
WaitKeyDown>VK122
Readln>%path%~shiplogdate~.csv,%k%,line
Separate>line,comma,var
Send Character/Text>%var_3%
Wait>.3
Press TAB
Goto>start
Hope this helps,
Dick
I think you can accomplish this by running multiple scripts. I know you can do it by running multiple compiled scripts (exe).
For example I have a user who has four exes running. All started by one exe. Each of the four "pastes" a different column from a csv file line when he presses either F9, F10, F11 or F12. The four exes look more or less like this:
Let>path=TEMP_DIR
Let>comma=,
Let>k=0
Label>start
Let>k=k+1
WaitKeyDown>VK122
Readln>%path%~shiplogdate~.csv,%k%,line
Separate>line,comma,var
Send Character/Text>%var_3%
Wait>.3
Press TAB
Goto>start
Hope this helps,
Dick
Last edited by JRL on Thu Aug 18, 2005 3:09 pm, edited 1 time in total.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Don't think you can run and wait at the same time.
WaitKeyDown> will pause the macro until a certain key is pressed. You could use a combination of these to wait for a key combination.
The only other option might be to use a Run Program with RP_WAIT=0. The Run Program would open another copy of Macro Scheduler, calling a specific script to keep running. This Run Program would be called just before WaitKeyDown>, something like this:
This should run macro script filename.scr and wait for the tilde key (~) to be pressed before doing other stuff.
Since filename.scr is running independently, it would be running in background while first macro is wating for the tilde key.
The second macro script that is running could be doing a check for a value in an INI file.
If that value exists, then the macro could pause and loop until INI value is cleared, then continue.
This is just an untested concept at this point.
WaitKeyDown> will pause the macro until a certain key is pressed. You could use a combination of these to wait for a key combination.
The only other option might be to use a Run Program with RP_WAIT=0. The Run Program would open another copy of Macro Scheduler, calling a specific script to keep running. This Run Program would be called just before WaitKeyDown>, something like this:
Code: Select all
Let>RP_WAIT=0
Run Program>C:\Program Files\MJTNET\msched c:\path\filename.scr
WaitKeyDown>~
EditIniFile>........(set a value to pause filename.scr)
Do Other Stuff.......
EditIniFile>..........(set a value to reactivate filename.scr)
Since filename.scr is running independently, it would be running in background while first macro is wating for the tilde key.
The second macro script that is running could be doing a check for a value in an INI file.
If that value exists, then the macro could pause and loop until INI value is cleared, then continue.
This is just an untested concept at this point.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!