Open Macro Scheduler with hot key

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

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

Open Macro Scheduler with hot key

Post by JRL » Tue Jul 11, 2006 7:27 pm

Hello,

I've been wondering about this for some time but have avoided bringing it up because its not very important. Since most Macro Scheduler forum posters seem to be on vacation this week, I thought I'd mention it now just to see the article count increment by one.

I have a one line program that unminimizes Macro Scheduler:

WindowAction>0,Macro Scheduler 8*

I have the program tied to the hot key combination Ctrl+Shift+F2. If Macro Scheduler is running and minimized, the hot keys bring it to the screen and all appears to work fine until I want to minimize it again. Picking the X or picking the underscore from the upper right hand corner does nothing. If I then pick on the MS cog icon in the taskbar, nothing appears to happen, but picking the X and/or underscore will again minimize Macro Scheduler.

I've tried setting WF_TYPE with no success. Any other ideas?

Thanks,
Dick

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Tue Jul 11, 2006 9:06 pm

I don't have an idea about how to get around this situation, but I can confirm that if MacroScheduler (for lack of better terminology) is "maximized" by itself, it seems to not want to minimize with the normal methods.

Does it appear that there is a macro running when you press the hotkeys?

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

Post by JRL » Tue Jul 11, 2006 9:14 pm

The macro doesn't run long enough for the cog to blink yellow once. I'm suspecting that the software must be "maximized" by the cog icon in order to be in a state that will allow it to be minimized.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Jul 12, 2006 12:11 pm

Dick,

This is because when you "minimize" to the tray Macro Scheduler is not actually being minimized - technically it is not minimized in the way Windows normally minimizes applications to the task bar. When you minimize/maximize Macro Scheduler additional code is taking place to handle the hide/reveal process, change the menu options accordingly, and remember the state. This code would not be processed when you issue WindowAction as all that does is send the standard Windows message so only a default Windows minimize/restore takes place. That's why the state of the window hasn't changed. The same is true for many other "system tray" applications. Sorry!
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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

Post by JRL » Wed Jul 12, 2006 1:02 pm

Marcus,
Thanks for the reply. More or less the answer I was expecting but I don't have technical background information to draw from to know for sure.

The windows key + D will minimise Macro Scheduler (along with all other windows) after maximizing using WindowAction>. WindowAction> will maximize Macro Scheduler after minimizing with winkey+D. You still have to pick the cog icon in the system tray if you want the X or underscore to work but essentially I can perform most of my work without my fingers leaving the keyboard.:)

Thank you,
Dick

hvdberg
Junior Coder
Posts: 39
Joined: Wed Jul 12, 2006 1:50 pm
Location: Netherlands

Post by hvdberg » Wed Jul 12, 2006 7:21 pm

A while ago, I accidentally found a way to be able to control a systray icon TOTALLY with the keyboard. Here's the explanation and the scenario to eliminate mouse usage in this kind of situation completely.

When you hover the mouse over a systray icon, it nearly always shows a balloon tip. The first letter of that balloon tip turns out to be the accelerator key that you can use. An example will probably clarify it more than an essay :wink: so here goes

Macro Scheduler has a balloon tip that reads 'Macro Scheduler 8.0.3' so the key sequence for activating it is:

Windows key
Escape
Tab
Tab
Tab
M

This key sequence assumes that you haven't disabled the Quick Launch toolbar. If you have, drop one Tab from the above sequence

If you have more systray icons that have a balloon tip that start with an M, you need to cycle through them until the cogwheel has focus.

Once the dotted cursor is around the cogwheel, a simple Enter is sufficient to put the main window of Macro Scheduler on your screen
The other useful option is hitting the key on your keyboard for the context menu. When you do that, you can use the X to kill Macro Scheduler

All without a single touch of the mouse!

It does require a little bit getting used to, but for you keyboard jockeys out there (needless to say that I'm a proud member of that guild) this should work.

Best,
Henk

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed Jul 12, 2006 8:16 pm

hvdberg wrote: Windows key
Escape
Tab
Tab
Tab
M
Hmmm, I must be doing something wrong because that's not working for me :cry:

Windows key - opens Start Menu
Escape - closes Start Menu
Tab - highlights first item in Task bar
Tab - highlights the systray expansion button ">"
Subsequent Tab or M doesn't do anything

:?

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Jul 12, 2006 8:23 pm

Very smart. I hadn't even realised it was possible to give the system tray keyboard focus.

However, on my set up there's an additional step - I have to press the right arrow key after pressing tab. So for me, on XP with the XP theme, it works like this:

Windows Key (This pops up the Start menu thus focusing it)
Escape (closes the Start menu leaving focus on the Start button)
Press Tab (moves focus to the task bar)
Press Tab (moves focus to the system tray)
Press Right (puts focus on first system tray icon)
Press m (moves focus to Macro Scheduler icon)
Press Enter (Activates Macro Scheduler)

As Henk says, if you have the Quicklaunch toolbar enabled you'll need an extra Press Tab.

So for me the full script is:

Press LWinKey
Release LWinKey
Press Esc
Press Tab * 2
Press Right
Send>m
Press Enter

Very smart. Thanks Henk!
Last edited by Marcus Tettmar on Thu Jul 13, 2006 8:06 am, edited 2 times in total.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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

Post by JRL » Wed Jul 12, 2006 8:43 pm

I have a similar experience. Tabbing never gets me to the icons. Sounds good for those it will work for.

Later,
Dick

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed Jul 12, 2006 11:00 pm

That added Right makes it work on my XP machine :D On another box which has "My Computer" at the right end of the task bar the third tab opens that so it needs:

Windows Key (or Alt S)
Escape
Tab
Tab
Tab
Escape
Tab
M
Enter

Very cute :) Unfortunately not very portable but I could see uses for it.

hvdberg
Junior Coder
Posts: 39
Joined: Wed Jul 12, 2006 1:50 pm
Location: Netherlands

Post by hvdberg » Thu Jul 13, 2006 2:29 am

Perhaps it gets more portable if you use Shift-Tab instead of Tab. I'm running W2K so I don't have the option to check it on XP.

If you use LWinKey, Esc, Shift-Tab, Shift-Tab, you cycle from the Start menu, via the desktop to the systray instead of Start Menu, Task bar, Quick Launch, SysTray.

Same effect, just cycling the other way around. I'm curious to know if that removes the ambiguity on XP.

Best,
Henk

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Thu Jul 13, 2006 4:03 am

On my XP machine I still need the "Right" because after the Shift Tabs it's sitting on the ">>" or "<<".

Lwinkey
Esc
Shift Tab
Shift Tab
Right
M
Enter

my W2K machine doesn't need the Right, but it still works, just moves one systray icon along.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Ok, here's the portable version ....

Post by Marcus Tettmar » Thu Jul 13, 2006 8:27 am

Hi,

This version avoids using the keyboard to get focus into the system tray area. It uses the Win32 API FindWindow functions to locate the handle of system tray notification area and then focus it.

Code: Select all

Let>WIN_USEHANDLE=1
LibFunc>User32,FindWindowA,h1,Shell_TrayWnd,
LibFunc>User32,FindWindowExA,h2,h1,0,TrayNotifyWnd,
LibFunc>User32,FindWindowExA,h3,h2,0,SysPager,
LibFunc>User32,FindWindowExA,h4,h3,0,ToolbarWindow32,Notification Area
SetFocus>h4
//Change to first letter of icon to activate 
Send>v
//If more than one with same first letter, then repeat above line for each
Press Enter
Just change the letter in the send line and it should work on any system.

Thanks again for the tip Henk. Very useful. I have blogged it here:
http://www.mjtnet.com/blog/2006/07/13/a ... ray-icons/
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

hvdberg
Junior Coder
Posts: 39
Joined: Wed Jul 12, 2006 1:50 pm
Location: Netherlands

Post by hvdberg » Thu Jul 13, 2006 9:47 am

A bit hesitant to reply to your last addition to the thread, since it's strictly speaking a comment on your blog entry, but I'll do it anyway so that other people may benefit from it too.

In your blog description of the topic, I would advise you to note the fact that, if you have for example 3 systray icons that have the same first letter in the tooltip, you will need to repeat the Send> in the Macro Scheduler script 3 times.

For completeness' sake you may want to add my comment about the context menu (Okay, the action I describe with that may be somewhat unfortunate but you get the idea :D )

Best,
Henk

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Jul 13, 2006 10:30 am

hvdberg wrote:In your blog description of the topic, I would advise you to note the fact that, if you have for example 3 systray icons that have the same first letter in the tooltip, you will need to repeat the Send> in the Macro Scheduler script 3 times.
There is a comment to that effect in the code.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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