Technical support and scripting issues
Moderators: JRL, Dorian (MJT support)
-
JRL
- Automation Wizard
- Posts: 3532
- Joined: Mon Jan 10, 2005 6:22 pm
- Location: Iowa
Post
by JRL » Mon Sep 22, 2008 7:46 pm
The pause key will pause a Macro Scheduler script so I thought it would be the perfect key for pausing one of my compiled scripts. What I discovered is that the pause key in an onevent in the executable does nothing as long as Macro Scheduler is running. The pause key works perfectly if I exit Macro Scheduler and run my program. Apparently Macro Scheduler takes control of the pause key? (<--- that's a question)
The following script demos what I'm talking about. The modal message will only appear (indicating the script's OnEvent was triggered by the pause key press) If the script is compiled and run when Macro Scheduler is not active on the computer.
Code: Select all
//Pause=VK19
OnEvent>KEY_DOWN,VK19,0,Pause
SRT>Pause
MDL>Paused... Pick Ok to continue...
END>Pause
Let>k=0
Let>cycles=1000
Label>Loop
add>k,1
message>%k% of %cycles%
If>k=%cycles%,EOF
wait>0.01
Goto>Loop
Label>EOF
-
jpuziano
- Automation Wizard
- Posts: 1085
- Joined: Sat Oct 30, 2004 12:00 am
Post
by jpuziano » Mon Sep 22, 2008 9:58 pm
Hi JRL,
JRL wrote:Apparently Macro Scheduler takes control of the pause key? (<--- that's a question)
Only Marcus knows for sure on the internals but my guess would be - yes. Its a Hot Key that the MS program itself impliments and uses while running... perhaps via a Win32 Hook:
http://msdn.microsoft.com/en-us/library/ms997537.aspx
If you don't want MS to use the Pause key for this, you can change it to some other key or even to None (no key). In the MS Main window, click on Tools/Options and there's a field called "Pause running scripts with:" and mine is set to the default which is the the "Pause" key. You can click into that field and... hit some other key to change it to a new key or... hit the backspace key twice to change it to change it to "None" then click the OK button.
Take care