Macro Toolworks Products Discussion Forums :: General Discussion
Welcome Guest   
 Subject :a test to ensure the current macro is not already running.. 11-07-2011 16:14:22 
dan.web.01@gmail.com
Joined: 11-07-2011 13:56:48
Posts: 2
Location
I have a macro that simply serves as a "sleep" function for my audiobook player:
it waits for 20 minutes and then issues a <ctrl>P to pause the player. This way,
I can fall asleep to the audiobook and have it pause playing so that it doesn't
continue to play all night long.

The trouble is that sometimes I forget if I have already pressed the hot-key for
this macro (I turn off my laptop display, so can't see the macro running window).
I would like to have a way to determine if the macro is already running
at the beginning of the code and exit if so (or better yet, kill the older macro process
and initiate the new instance for a fresh 20 minute sleep period), but so far have
not found a way to do this. I have to have this macro run as a separate process,
so that may be limiting my choices for how to test to see if an instance is already
running. For instance, <shift><esc> at the beginning doesn't work, I assume because
the new macro is running in its own memory space (?).

Any ideas? I did try writing to the clipboard and testing it, but wasn't able to get
that to work either.

Thanks,
Dan
IP Logged
Last Edited On: 11-07-2011 16:17:11 By dan.web.01@gmail.com for the Reason
 Subject :Re:a test to ensure the current macro is not already running.. 18-07-2011 08:29:04 
petr
Joined: 15-10-2009 11:48:52
Posts: 152
Location
Hello,

you could use <msg> command to show the message that the macro is already running. The <msg> command can be configured so that it opens a message window for a given time so you could use it as the 20 minutes timer as well....

Best regards,
Petr
IP Logged
Page # 


Powered by ccBoard


Login and share your experience - send messages to forums and add comments to samples, commands and other resources.



Account is free of charge, easy to setup.