Jump to content
Macro Express Forums

Activating program, process / not windows


Alexis

Recommended Posts

If it comes to handling applications MEX3 seems to miss some important commands. To get some programspezific floating menus i wrote some macros. What´s really missing is the possibility to activate macros not by a window title but by the topmost active program.

 

Even worse: MEX3 ist not capable to switch to a running programm also this is described everywhere (In the book "MEX explained", in the wizard) . Instead it only can activate windows. But the windows-names of many programs are constantly changing. Specifying a certain title can cause problems. And if you choose launch program you get multiple instances or new documents you certainly not need.

 

What i want is not much. I want to get the program and the documents corresponding with that programm activated and displayed the way i left them. Just the way it works when i use the Alt+Tab Command to go back to a application. (The command should go like: "Activate Process OUTLOOK.EXE")

 

I can´t believe this is not possible.

 

Please proove me wrong. :rolleyes:

 

Thank you.

Link to comment
Share on other sites

First off if you have a feature request you should submit it to ISS at the Features Request Form. Without end user requests they can't possibly think of every possible thing folks want so it's our responsibility to let them know. And let me assure you that ISS is not resting on their laurels. I believe that very soon many of these problems will be rectified. Also don't forget this forum is not run by ISS although many of their flks help out here.

 

Secondly if you're just coming here to bash the product you're not likely to find many friends who are willing to help you find a solution. We try to be constructive and positive here and not adversarial. Having said that I think most will agree with me that there are many shortcomings to ME's activation, and window switching methods. It's just a suggestion but you might try a less condemning tone. And let me tell you I can understand how frustration can often get my goat as well. IOW I feel your pain.

 

Now assuming you are interested in getting help with a solution I would like to offer some suggestions that I hope will help. Because I too often have to spend inordinate amounts of time finding a workaround. But before we go too far could you give some specific examples? Often people speak in generalities here and usually the fine details can often grossly effect how one would approach the problem.

 

You speak of opening multiple windows to the same document which would obviously be a problem. But usually I find that if you launch a document, not the EXE, if open the application will switch to it instead of opening a new copy. What application are you having problems with and how are you launching it?

 

ME can switch to applications and it does those like us humans do, by the applications window. I write a lot of macros and I usually don't have too much trouble switching to the window I desire. There are some cases like multiple windows with the same title that can cause problems but even then there are usually workarounds. Activation can be handled by a partial window title match like "Word - ". Of course if you need to switch to another open Word document you might need to do something more elaborate like Repeat With Windows to find a specific animal. But again, without a specific example it's hard to give any advice.

 

So I agree that ME has shortcomings but I think if you give us a detailed description of a problem we can probably help you find a solution.

Link to comment
Share on other sites

Thank you very much Cory for your long, sensible and detailed response.

 

Nobody wants to bash a product which is great overall. At the moment i´m making a list of features i miss for ISS. But as a newbie i have to be sure that i do not request stuff i just overlooked. This forum helps me with that. I´m sorry i wrote the post in a frustated state. Actually i was quite sure that those "missed" features would be explained to me in a reply like other topics already have by the friendly and compent users here. But you are right. ISS cannot think of everything.

 

Let me explain in detail whats my goal because it can be useful for everybody here.

 

Activating macros with keycommands is not my thing. Thanks the power of MEX3-Macros (hey i´m getting positive right now ;) ) i´m using lots of them and i can´t memorize all those hotkeys.

 

So i like Floating Menus. But i want them specific for each application. And i only want to see them if the application is active. So i would have a bar of icons i can drag freely within the window i´m working with with all the macros i might need while using it. If i switch to another application the current Floating bar closes and a new specific bar appears.

 

Would you agree this would be a comfortable way to have access to your macros?

 

I certainly think so. At the moment i have all floating bars enabled and use additional Shower-Macros which fires Hide / Show Commands by window activation. One of my current problems ist those Hide /Show commands steals the focus from the clicked/selected window. (By the way I´m not using eabling/disabling because its to slow.) So i added an activate window command in the Shower-Macros to return to the target application.

 

Now, by selecting a window the applicationspecifc floating menu appears while the others disappear. Not to bad. :rolleyes:

 

But it takes about a second and the focus goes: 1 application - 2 floating bar - 3 application. Actually "3 application" is not true because i only can specify a window. Problems occur if i run macros which causes the target application to open new windows (like writing a new message in outlook) than i don´t see the message window because the Shower-macro will activate the window "Microsoft Outlook". (Or if the windowname of the application changes.) This would not be the case if there would be a way to just switch to a process like alt +tab.

 

But i think i found some kind of workaround. If i use the command "Setting window order" for my floating menus instead of Show/Hide the Floating Menus do not get focus. This looks very good. So i don´t need an activate window command. Problems gone. I have to check this out.

 

(Actually i thought of trying out "Reposition Window" first but i could not find a command "Get Window Position" and i would like to arrange the floating menus freely. Is there a way to get the coordinates of an specifc window?)

 

Thank you so far.

 

Alexandra

Link to comment
Share on other sites

But i think i found some kind of workaround. If i use the command "Setting window order" for my floating menus instead of Show/Hide the Floating Menus do not get focus. This looks very good. So i don´t need an activate window command. Problems gone.

 

Well, not really! Problems come back when i use other macros. MEX begins switching windows back and forth. I think it has something to do with the fact MEX runs only one Macro at the time. Although the code aktivated by the windows is really simple. (3 Set Order Commands to put one on top and 2 on bottom.) But enough to confuse MEX.

 

Do you think there will be a way to achieve those aplication specifically appearing Floating Menus (ASAFM) ??

 

I will try disabling the shower macros when performing the external macros and putting the Setting Window Orders directly in there if needed.

Link to comment
Share on other sites

Wow, that's really complex. Personally I don't use floating macros so I'm afraid I'm not going to be much help there. Hopefully someone else can give you some better ideas. But I like you're thinking with switching depending on the application. I rarely get into making things like this but when I do I rather like to create toolbars with buttons in the application. To me it just seems to make more sense to use the application's toolbar instead of recreating the wheel. Also for things like starting a new mail message in Outlook I use the built in hotkeys like CTRL+SHIFT+M. Or I will use the built in VBA macros. If I get more time later I'll read your message again and see if I can follow what you're doing but the end of the year is near so there's not a lot of free time.

 

And I'm sorry for the long winded post. You see I'm just lazy and it takes me twice as long to think of a concise response so I tend to ramble! Good luck!

Link to comment
Share on other sites

Thank you Cory, thank you Paul,

 

i still have the hope to fix this in MEX. As long i will not install other tools.

 

Actually it´s quite simple:

 

I have 3 applications: Word, Outlook, Firefox.

I made 3 Floating Menus. One for each of them.

 

As those nasty beasts keep floating on top of everything i decided to make 3 additional macros. Again, one for each. I call those shower macros. Those macros set the window order of the three floating menus depending of the active window.

This is the scripting code of "Firefox Shower":

 

Set Window Order: Set "Firefox Floating" to always be on top

Set Window Order: Set "Outlook Floating" to the bottom

Set Window Order: Set "Word Floating" to the bottom

 

This macro is activated by window "Mozilla Firefox"

The two other showers work accordingly.

 

This works perfectly. With a short delay you get to see only the relevant specific menu. And they appear where you left them. You should try out this. I should be happy. I am, but... :huh:

 

Well, Problems occur when i use my other floating menu. Yes, i have a fourth one. And this is the biggest one of all. Its my Gloabal Floater and has a special place reserved on my desktop. I do not go to Outlook and press a Hotkey to send a message. A macro is doing that for me. It begins of course with "Activate Windowtitle Microsoft Outlook". By now i guess you figured out the problem:

 

By activating Outlook the corresponding shower macro fires and MEX is goin crazy. I think it has something to do with the fact MEX only can run one macro at the time.

What i need would be a command like "wait for macro finished" or "Pause/continue macro xy"

 

Maybe i should try out the "wait for window" commands or the Delay, Timed Delay-Commands. Did not understand yet whats the difference between those. :(

 

Any suggestions are wildly appreciated :P

 

Alexandra

Link to comment
Share on other sites

Ahhhhhh.... Now I understand. And I have a possible solution. I too have macros that open up an email to compose to someone and although I use a hotkey the method it might interest you. Instead of switching to Outlook and going from there I launch the new message dialog from the command prompt. In the Program Path/Name box enter the OL executable EG, "C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE" and in the Program Parameters box enter "/c ipm.note". This takes you directly to a compose note window bypassing Outlook.

<LAUNCHDEL2:0:01C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE<PARAM>/c ipm.note>

Link to comment
Share on other sites

Well Cory, thank you very much,

 

but because i have enough macros running on applications not capable of beeing executed with parameters i have to get this problem solved.

 

If you tell me that there is now way to make one macro waiting for the other one or any other workaround for my problem i have one item more to add to the ISS Wishlist (Christmas is close ;) )

 

Thank you

 

Alexandra

Link to comment
Share on other sites

Yeah that was a sleazy answer attempt wasn't it <g>. OK I’m reading your explanation again but now I see something funny where you say it’s going crazy. If you are running your macro to open OL and compose a new message the macro normally triggered by opening OL directly should not fire yet because, as you pointed out, we can only run one macro at a time. So is the problem that the macro you use to popup the OL floating macro is firing after the macro to create a new message? If so I may have an answer but I need to check to make sure I get my facts right.

Link to comment
Share on other sites

Ah, I found it. This may not be relevant depending on your reply to my last message. This is an option in the cachine page. Here's a quote from the help file:

Window Activation Caching (Also applies to Window Control Activation)

 

This option pertains only to Window Activated and Window Control Activated macros. Here is the scenario when this option would be relevant. It's possible that you may have one or several macros activated by a Window title. Let's say a macro runs and it opens a window that should trigger your Window Activated macro. But the first macro still has other commands to process. Since the first macro is still running, the second Window Activated macro will not trigger and run because two macros won't run simultaneously. With this option checked, the Window Activated macro will be queued. Once the first macro has finished playing, then the queued macro will start. This same scenario would apply to Window Control Activated macros as well.

 

If you don't want to have the macros queued, remove the check next to this option.

If your problem is that the one macro is firing after the other is complete you can disable this option. But I’m not sure what you mean by “goin crazy” so I’m not sure if it applies. If this isn’t a solution please describe how it’s “goin crazy”.
Link to comment
Share on other sites

Thanks Cory,

 

actually i don´t know about the sequenze. The Floating Menu appears later so i think you may be right that the "New Message Command" is performed before. But as you know the resulting new message window has no "Microsoft Outlook" in its title. So eventually the macro doesn´t fire at all.

 

(By the way, that was the reason i asked for process not window activated macros.)

 

The crazyness are two things. In the example above after the macro the new message-window does not have focus but another program. Word most of the time. Other macros are focussing other programs after running. To get to the original program, the one which was "makronized" i have to press Alt+Tab once. (Can i perform something similar with MEX?)

 

Sometimes MEX is switching between those 3 applications endlessly. Focussing other programs via mouse stops that game.

 

Everything is working normally with the shower macros disabled. As i posted those just have 3 script lines. I assume some focus problems. Its a pity that ISS do not document which command/window operations steals the focus and which not. You have to try out so much. :(

 

I think the best is to try it yourself:

Word Floating Shower:

 

<ZORDER:0:Word Floating><ZORDER:2:Outlook Floating><ZORDER:2:Firefox Floating>

 

Firefox Floating Shower

 

<ZORDER:0:Firefox Floating><ZORDER:2:Word Floating><ZORDER:2:Outlook Floating>

 

Outlook Floating Shower

 

<ZORDER:0:Outlook Floating><ZORDER:2:Word Floating><ZORDER:2:Firefox Floating>

 

Make 3 Floating Menus with the corresponding Names. Than run a normal Macro adressing Outlook for example.

 

En / Disabling Window Activation Caching did not change much.

 

Thanks again very much.

 

Alexandra

Link to comment
Share on other sites

I think there may be some subtle problem with your logic given the way you describe the focus loss. And I'm almost certain the Activation Caching would be causing the problem. You see when you call the new mail message macro ME will have seen the window title for Outlook and as soon as it's done running it will then fire the shower macro which, depending on how it specifically works, could cause it too loose focus because you are re-ordering windows. I'll have to make my own little sample macro and give it a try but i don't know if i will have time today.

 

BTW, if you don't want to see the other toolbars why don't you simply close them when not needed instead of re-ordering?

Link to comment
Share on other sites

I was having troubles following your explanation and I don't have FireFox so I just tried to do one myself. See the attached file. There are 5 macros consisting of two floating menus, two menus for switching floating menus and one that composes a new mail message in Outlook. It's all very simple. The one menu if for Outlook and the other menu is for Calculator. Problem is it works just as I expected and I don't have any craziness. Perhaps you could look at my macro and see if there's something I'm not doing the way you like. BTW, the buttons in the floaters don't do anything.

Floaters.mex

Link to comment
Share on other sites

Alexis, Cory:

 

I've so far not used menus much, but I'd like to do so. It's getting hard to remember all my hotkeys, and my cunning plan of switching to more easily-remembered Shortkeys has hit a major obstacle because shortkey activation seems erratic/unreliable. (See separate thread.)

 

However, most of your discussion has left me behind! An added probem is that I don't use Outlook, so can't confidently try Cory's examples. I don't want to hijack the discussion of Alexis's problem, but I'm wondering if you could help me over the initial hurdles by a simple example involving say Notepad and Calculator please? Either here or in a separate thread? The aim being that I have a floating (or pop-up?) menu at my service when I use either or both programs. Populated with operations that can't be achieved using the application's own tools. I could then apply these principles to my more complex applications.

 

Presumably I have to activate these menus manually? IOW, I assume MEX can't automatically display a menu when Notepad is launched, for instance? (At least, not without running another 'supervisory' macro permanently?) So would I activate by opening a 'Top Menu', in my system tray, then clicking the appropriate item 'Notepad Menu' or 'Calculator Menu'? Or maybe use a shortkey 'zn' for Notepad Menu, and 'zc' for Calculator Menu, if I can get these to run reliably?

 

Am I on the right lines here?

 

Oh, and what on earth is a 'shower menu' please?

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

You know Terry I really am getting out of my depth here. There are a couple of corners I don't know much about in ME and this is one of them. I come from a background of the very early days of PC CADD (Drafting) and I can remember getting my first SVGA (800X600) 14" color monitor. When working on D sized drawings every pixel counted and although AutoCAD had onscreen menus we all turned them all off to maximize our editing space. So I learned to write scripts, commanded by typing left handed on the keyboard, and moused (digitizer) with my right, eyes never leaving the screen. Thousands of hours of this conditioning means as soon as I install a new application the first thing I do is figure out how to disable most, if not all, the damn toolbars. Think about it, most users aren’t even aware of what most of those buttons are and only use a couple like the Open button which can more easily be accomplished with a CTRL+O. To me they’re just a waste of space and time. Of course these days large displays are becoming so prevalent it’s becoming antiquated way of thinking but I still can’t see the efficiency of having to move the toolbars all the time when editing in Photoshop.

 

I don’t ‘get’ the Floating Menus. Since I admonished Alexandra a little and no one else was chiming in I thought I should try to help and take it as an opportunity to learn a little about them since she was so pleasant about it. As far as I can tell there is no activation available and they’re designed to just run whenever ME runs. Also you can not use the Macro Run command to launch them. So to me they just appear to be disembodied toolbars of ME. Now I can see Alexandra’s frustration as I think she’s trying to do more that the original intent. Having said that it appears they can be manipulated to some extent. She wants them to be context sensitive which makes sense but since they run at startup and are always around the only way I could figure to make them work for me was to minimize and restore them with another macro since there is no activation.

 

My advice to Alexandra and to you is to try something different. I think it would be much better to use popup menus instead. I do this for a few clients where the macros become too numerous to remember. I assign it to the middle mouse button and sometimes structure them in a hierarchy so they’re always a click or two at most away. But the important part is that once they’ve served their purpose they go away. It’s also nice that they popup where the mouse is already saving moves. And for Alexandra she can make the context sensitive so that if Outlook is on top it pops up the Outlook menu. Also in my popup I usually have the first macro in the list link to a web page defining all the macros and hotkeys for activation because you know we can never remember all that. But I have not spent a lot of time so I would love to hear Joe or Kevin’s thoughts on Floating Menus.

 

If you want to try my sample macro without Outlook simply open it up and replace Outlook with Notepad. Also there is a tutorial in the sample macros you should take a look at. Hey, now that I look at it I see that they appear to have ‘launched’ a floating menu. Turns out they use Macro Enable to accomplish the task. Clever. That might work for Alexandra although it still seems it’s not intentioned to be turned on and off like this but rather something that stays up all the time.

 

Also I don’t use ShortKeys much. It seems no matter how I try it always ends up conflicting with something else. Although using them like one uses AutoText in Word is helpful when not using Word but then again if you have Word why would you type in anything else? In fact I’m typing in word now.

 

Well that’s long enough. I hope Joe has some time to comment. I might have this all wrong and I’m sure he could learn me a thing or three.

Link to comment
Share on other sites

Many thanks Cory, appreciate your taking the trouble.

 

I reckon I agree with you about preferring pop-up over floating menus. I think I'll focus on expanding what I did a year or so ago when I made a tentative exploration of menus. I have an icon in my system tray (darned if I can recall how I put it there!) which brings up a list of macros, each of which is itself a menu. Some are specific to programs, others generic. So I have

- Google Earth MENU

- Graphics MENU

- Memory-Map MENU

- Movies MENU

etc

 

Within each of those are my specific macros.

 

Main downsides are:

1) Not as fast as hitting a hotkey

2) I will have to alter those of my hotkey-activated macros that assume I'm starting with the mouse hovering in a certain place. These will presumably need me to add a Text Box Display instructing me to manually place the mouse pointer.

3) Menu list can sometimes obscure information

 

The plus of course is that I don't have to remember a steadily increasing number of hotkeys.

 

I was interested in your point about displaying a list of all the macros and their activations. (BTW, why a web page rather than a simple text file? Better appearance? Is maintenance an issue?) You could in fact make an argument for doing that and then just using the appropriate hotkey. IOW, pop-up the list, recall the hotkey, and activate the macro with it. That avoids the mouse movement issue.

 

I'll do some more studying, including the tutorial. I usually find that once I've got a few practical examples working, the penny begins to drop.

 

As for shortkeys, seems like I'm still looking for a guru on that subject then! Hope you'll follow the thread anyway and chip in with any ideas or experience. Maybe you could just try that ultra-simple macro I posted earlier today? It's so frustrating to have a macro work with one activation and not another ;-(

 

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Wow, guys this thread is getting really busy. Interesting! Thank you.

 

As both of you are not so familiar with floating menus i would like to share some insights, i made so far.

 

  1. FM are for me better than Popups because i have enough space (4 Monitors) and the macro needed is one click away, always at the same place.
     
     
  2. Actually, even large numbers of FM are not causing any trouble, as long they are not automatically manipulated (for example by window-activation)
     
     
  3. If you want to show/hide them, to increase overview in case you have lots of them, the best way is to manipulate them by the command "Set Window Order" ("to always be on top" vs. "to the bottom") Other possible commands like minimize/restore or enable/disable are causing trouble because they can give the focus to the FM which you don´t want.
     
     
  4. My Logitech G15 Macro Keyboard is constantly scanning the current process. If i used other commands i only get the application focus for a second. Than the focus goes to the FM and the macro keys on the keyboard don´t work. By the way the darker blue colour of the FM for showing active window is not reliable. My LCD on the G15 is!
     
     
  5. At the moment i have 3 programspecfic Floaters constantly running. And i have 3 programspecific Macros all with the same Hotkey. If i need programspecific Macros i press it, and the corresponding FM appears where i left it.
     
     
  6. This is nice, but not as good as get them automatically displayed. I still would like to work on that.

Thank you

 

Alexandra

Link to comment
Share on other sites

So did you try my macro? I would be interested to know because it works for me and does what I think you are describing. If it doesn't work for you and it does for me we're getting somewhere.

 

Even with 4 monitors you need to mouse over to get them. I run 3 monitors and I'll grad race you to see if the FM's are faster than my middle click popups. :)

 

So aren't you concerned that if you have a macro keyboard and Macro Express you might be having some conflicts? I'm not sure if that's possible but I thought I would mention it. I don't get into gamer hardware much.

Link to comment
Share on other sites

Pardon me, you English was so good I didn't suspect you were not a native speaker. Where are you from? One of the things I love about this forum is the wonderful diversity of folks from around the world that hang out here.

 

I’m sorry if you feel misunderstood but before we go any further did you try my sample macro? And if you did what was the result. Don’t forget you need to use it while Window Activation Caching is disabled. I asked before but you made no indications. I feel that if you don’t that I don’t want to spend the time to review what I created then I’m wasting my time. It’s my contention that you’re not looking for help with a solution or workaround but rather making complaint/features lists.

 

I think you’re missing some fundamental concepts here as is evident by your list. I won’t go into all of them as I need to get back to work but one of your items was to Wait Until Macro Finished. This makes no sense. It is a fundamental limitation of Macro Express that it can not run more than one macro at a time. This is why I think you’re seeing the Activation Cache. If you use my sample macro I think you will see what I mean. Turn on the activation cache and it goes haywire. Turn it off and everything works flawlessly.

 

Good luck with your features request list and don’t forget to submit them to Insight’s Feature Request Form. Oh, and you should probably break them up into separate requests as each would require individual consideration and implementation.

 

Sorry I could not be of more help, I hope someone else who is more experienced with floating menus can join in and help you.

Link to comment
Share on other sites

Thanks for the follow-up Alexandra. You're way ahead of me in your use of menus in general, and pop-ups in particular. But I'm going to set aside some time to experiment and will use this thread to help me, complementing the tutorial Cory recommended.

 

Have you also used shortkey activation very much? As one of your motivations (like mine) is to avoid having to remember so many hotkeys, I'd have thought this was a promising alternative?

 

Although it's going off at a bit of a tangent, can I get your interest in my issue about shortkeys please. I'm baffled why macros activated by a shortkey sometimes fail, yet work OK with a hotkey. Obviously, until this is resolved, it's a serious handicap to using shortkeys confidently. I use scores of them at present for simple stuff, like entering frequently-used folder names in browse windows, or typing common words/phrases. But it's only recently that I've tried using shortkeys to replace hotkeys in my more complex macros. That's where I've hit these problems.

 

Perhaps you could try this this ultra-simple macro, for use on any selected filename in a Windows folder.

 

Mouse Left Button Click

Delay 500 Milliseconds

Macro Return

 

<LCLK><MSD:500><MRETURN>

 

You just highlight a filename in any folder and activate the macro. It should just 'open up' the filename ready for for editing/copying.

 

Here, with any shortkey, it fails. (It somehow goes 'up the tree' so that the result displayed is My Computer or sometimes the Desktop folder. No ill effects, just totally wrong result.) Yet with a hotkey it works perfectly.

 

(Note that I've deliberately not used the alternative of entering F2 instead of left-clicking, because many of my programs don't support F2 for editing.)

 

Feedback from anyone else would of course also be much appreciated too please.

 

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...