FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   Add to FavoritesAdd to Favorites
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    RSS Get RSS Feed  


Adding a PAUSE button

 
Post new topic   Reply to topic    Macro Scheduler and Windows Automation Forum Index -> Technical / Scripting
View previous topic :: View next topic  
Author Message
aboredprogrammer
Junior Coder


Joined: 27 Jan 2010
Posts: 40

Reputation: 14.5
Earn Points, Win a T-Shirt

PostPosted: Mon Feb 08, 2010 6:22 am    Post subject: Adding a PAUSE button Reply with quote

Hello,

I have been trying to add a "pause" button feature to my dialog. For example, if the user clicks "start" the script will run, and if they want to pause the script they click pause, and when they want it to continue, they click start. I have tried this below, but I could be going in the completely wrong direction:

Label>pause
GetDialogAction>dialog1,r
Goto>Loop

Am I heading the right direction?
_________________
aboredprogrammer

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
JRL
Automation Wizard


Joined: 10 Jan 2005
Posts: 1804
Location: Iowa
Reputation: 525.9
votes: 45
Earn Points, Win a T-Shirt

PostPosted: Mon Feb 08, 2010 4:20 pm    Post subject: Reply with quote

First - Are you aware that there is a built in "pause" feature for Macro Scheduler? If a user presses the "Pause" key while Macro Scheduler scripts are running, all running scripts will pause until the user presses the "Pause" key a second time. There is no confirmation that scripts have paused or restarted so this might not work for you.

It appears you want to use a "Pause" button on a dialog, your script needs to go into an idle condition when the pause button is pressed. This could be accomplished by opening a modal message or dialog or by going to a loop that is broken when a button is pressed.

From what you posted, It looks to me like you've decided to use a modal dialog. One way this could be accomplished would be to have the pause button jump to a label or subroutine where you would reopen your dialog modally. opening a modal dialog stops script processing until someone presses a button on the dialog. Here's a simple example where pressing "Pause" then "Start" will start and stop your script.


Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
aboredprogrammer
Junior Coder


Joined: 27 Jan 2010
Posts: 40

Reputation: 14.5
Earn Points, Win a T-Shirt

PostPosted: Thu Feb 11, 2010 6:39 am    Post subject: Reply with quote

Hey,

Sorry for the late response JRL. I have been very busy with work lately. I haven't got around to testing the Pause button yet with the code you supplied, but I will very soon. I will let you know how it goes!

Thanks!
_________________
aboredprogrammer

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
aboredprogrammer
Junior Coder


Joined: 27 Jan 2010
Posts: 40

Reputation: 14.5
Earn Points, Win a T-Shirt

PostPosted: Thu Feb 11, 2010 9:00 pm    Post subject: Reply with quote

JRL,

I tried your code and couldn't get it working the way I had intended. However, I was messing around with stuff for about a half hour, and constructed a small code that works perfectly!

Thanks for your help!
_________________
aboredprogrammer

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
Display posts from previous:    View previous topic :: View next topic  
Post new topic   Reply to topic    Macro Scheduler and Windows Automation Forum Index -> Technical / Scripting All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group