compiled macro, hit SHIFT+ESC and run code before exiting

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

compiled macro, hit SHIFT+ESC and run code before exiting

Post by jpuziano » Fri Dec 31, 2010 3:36 am

Hi Marcus and everyone,

I have a compiled macro that communicates with a server.

I'm using the default key combination SHIFT+ESC to terminate the compiled macro however I'd like to execute a bit of code immediately prior to exiting to tell the server that the user has terminated the macro.

Yes, I could use some other key combination that when hit would run my code and then exit... but I'd prefer to stick with SHIFT+ESC because my compiled macro runs in the background and all the user sees is a systray icon to let them know its running. When the user hovers the mouse over the systray icon, the tooltip "SHIFT+ESC to Exit" appears which reminds the user what keys to hit if they want to exit.

Is there any way to do this? If not, can this be added?

The ability to change the systray icon tooltip would also provide a solution - is there any way to do that? If not, can this be added?

Thanks for any replies and take care
Last edited by jpuziano on Sun Jan 02, 2011 10:27 am, edited 1 time in total.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Dec 31, 2010 5:59 am

I haven't tried it but it seems that you could put a key_down OnEvent> line in the script using VK27 (esc) with a shift modifier (1) then compile with Shift+Esc disabled and you'd have most of what you're looking for.

Code: Select all

OnEvent>Key_Down,VK27,1,Quit

SRT>Quit
  MDL>Do something before exiting
  Exit>0
END>Quit
See help for AddTrayIcon> to do the custom icon part of your request. See Rain'sMouse Cursor Monitor for "how to" a sample.

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Fri Dec 31, 2010 3:31 pm

Use APP_TITLE to change the tooltip in a compiled exe.

Code: Select all

Let>APP_TITLE=Custom Tooltip
mdl>Tooltip is now "Custom Tooltip"

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Sun Jan 02, 2011 10:44 am

Hi JRL and Rain,

I just wanted to thank you both... between your two replies, I think I'll have what I need (and if not, I'll post again). :)

Take care
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

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