AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How do I pause another script?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
triwebb1



Joined: 06 Mar 2008
Posts: 20

PostPosted: Wed Apr 23, 2008 1:01 am    Post subject: How do I pause another script? Reply with quote

Hi. I have several scripts running at once, and I want it so that when I hit the pause key they all pause. Does anyone know how to do this? I can make it work fine for one script, but when I run two instances of that script, only the last one to start responds to hotkeys.

I am using a token-passing system to allow the scripts to pass along control of the mouse, and I could easily add a bit to send/recieve a pause message, but I have been unsuccessful at making the script pause when it receives that message.

I am guessing that it is a limitation of AHK to only be able to have one script respond to the pause key, and that is why I mentioned the message passing bit. I have not thoroughly investigated/debugged the pause message part, I will do so right now to see if I can find out why it doesn't work.
Back to top
View user's profile Send private message
Epuls56



Joined: 19 Apr 2008
Posts: 33

PostPosted: Wed Apr 23, 2008 1:09 am    Post subject: Reply with quote

Have you tied #SingleInstance?
Back to top
View user's profile Send private message
triwebb1



Joined: 06 Mar 2008
Posts: 20

PostPosted: Wed Apr 23, 2008 1:27 am    Post subject: Reply with quote

That would defeat the purpose, I believe. Do you mean turn it on or off? I have it turned on. What I have is a manager script, and a worker script. I run one instance of the manager, and multiple instances of the worker. I need the pause key to work for the manager and all instances of the worker.
Back to top
View user's profile Send private message
Z Gecko
Guest





PostPosted: Wed Apr 23, 2008 2:44 am    Post subject: Reply with quote

take a look here: http://www.autohotkey.com/forum/topic22401.html

SKAN gave very nice example.
Back to top
triwebb1



Joined: 06 Mar 2008
Posts: 20

PostPosted: Wed Apr 23, 2008 5:41 am    Post subject: Reply with quote

Thank you very much for finding that for me - I should have looked harder... I will use that message code as it is very easy.

Anyway, I found my problem, and it was a silly one. I forgot to make the array that contains the window IDs global in this new function, and that is why the worker scripts never got the message. It's always the little things that cause the most frustration...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group