Can you pause a running macro? Not stop

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
mykeasaurus
Newbie
Posts: 7
Joined: Thu Sep 01, 2005 2:10 am

Can you pause a running macro? Not stop

Post by mykeasaurus » Tue Sep 06, 2005 12:12 am

Is there any way to pause a macro and then play it right where it left off? Ive got a computer that I cant use because its running a macro, but every now and then I'd like to check things on the computer, but if I stop the macro in the middle of its cycle, its variables will get messed up. (each cycle is around 2 hours)

Help!

User avatar
CyberCitizen
Automation Wizard
Posts: 724
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Tue Sep 06, 2005 1:59 am

Yes It Is Possible However You Need Version 7.4 03/09/2005 Or Above!

Added ability to Pause/Resume all running scripts (not compiled macros) using Pause key.

To pause all running scripts during execution press the Pause key. Pressing the Pause key again will resume paused scripts.
FIREFIGHTER

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Sep 06, 2005 7:09 am

Something to be careful of if pausing macros. Say you have a macro which at the beginning uses SetFocus to focus an application and then sends a whole load of keystrokes. Say you Pause it half way through and do something on the computer which changes the window focus and then resume the macro. The pending keystrokes will end up in the new window that you manually focused. So when resuming macros it will pay to put the system back in the state it was in when you paused.
MJT Net Support
[email protected]

Waldo
Junior Coder
Posts: 20
Joined: Fri Oct 29, 2004 4:22 am

An Easy Way... just using Mouse..

Post by Waldo » Tue Sep 06, 2005 7:12 pm

Here's an easy trick I do to suspend the program....

I put a "Move mouse here to PAUSE" dialog (or MSG box) at the bottom of the screen.
Then I simply check the mouse coordinates periodically within the program. If the GetCursorPos>X,Y coordinates fall within my dialog box... I display another non-modal dialog box at the bottom with optional buttons to RESUME, START OVER, or QUIT.

The GetCursorPos statement is misleading. It actually returns MOUSE position. There's a difference....

Hope this helps

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Sep 06, 2005 7:42 pm

Why is it misleading? GetCursorPos gets the mouse cursor position. It gets the position of the Windows mouse cursor. For the text cursor use GetCaretPos.
MJT Net Support
[email protected]

Waldo
Junior Coder
Posts: 20
Joined: Fri Oct 29, 2004 4:22 am

GetCursorPos

Post by Waldo » Tue Sep 06, 2005 8:08 pm

Well, misleading initially to ME (I'm slow).

The documentation for GetCursorPos never mentons the word MOUSE.

So to me, there is a distinction... When using my word processor, the "cursor" is where the next character that I type will appear. The mouse position could be anywhere on the page.

If the Help file for Mouse commands included the hypertext link to this command, I probably wouldn't have missed it. Again: my mistake.

Now on a completely separate note: I am completely amazed by the quality of support that I/We receive from you guys at MJT.NET.. The mark of a great company is its commitment to its customers by continual product improvement. You guys are releasing new, improved versions faster than I can download them. Well done!

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Sep 06, 2005 8:10 pm

Fair point. I've just looked at the documentation and I see now that it doesn't mention the word mouse in GetCursorPos. I will make sure it is clarified next time it is updated.
MJT Net Support
[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts