jsampsonyyyyy Posted June 11, 2016 Report Share Posted June 11, 2016 Is it possible to write a macro which selects the window of a running program and moves the mouse to a position relative to that window? One would need to set the mouse locator to show the position relative to that window, so as to know how to set "mouse move". Of course while writing the macro the currently-running program is Macro Express Pro, not the program of interest. The mouse locator does not then show the mouse position relative to the program of interest. Is it possible to make it do so while writing the macro? Quote Link to comment Share on other sites More sharing options...
acantor Posted June 11, 2016 Report Share Posted June 11, 2016 Something like this? Use the "Mouse Locator" to identify the x y position in the target window.If I understand correctly, you want to position the mouse relative to a different window than the one that is currently focused. Variable Set String %CurrentWindow% to topmost window title // Window Activate: - Target Window Delay: 500 milliseconds // A delay may or may not be needed // Mouse Move: 123, 456 Relative to Current Window // // Do what you need to do in the target window // Window Activate: %CurrentWindow% Quote Link to comment Share on other sites More sharing options...
jsampsonyyyyy Posted June 11, 2016 Author Report Share Posted June 11, 2016 Many thanks. The macro doesn't work so I expect I will be back with more questions. Quote Link to comment Share on other sites More sharing options...
Cory Posted June 11, 2016 Report Share Posted June 11, 2016 It's pretty simple. You start the command and select the option to be relative to the window, launch the locator, change focus to the window, position your mouse, and type CTRL+Space. I think people often forget to read the short instruction in the command and fail to change the method to be relative to the window instead of relative to the screen. Quote Link to comment Share on other sites More sharing options...
jsampsonyyyyy Posted June 15, 2016 Author Report Share Posted June 15, 2016 What is "Window Activate" actually supposed to do? When I try it it does nothing. Are there conditions to be satisfied before it does anything? I want to change focus to a particular window - if this is the wrong command which is the right one? Thank you for the "CTRL+Space" tip. Quote Link to comment Share on other sites More sharing options...
acantor Posted June 15, 2016 Report Share Posted June 15, 2016 The condition that must be met is that the window title you specify matches, in whole or in part, the title of the window you want brought to the fore. Hint: the window title is often in this format: XXXX - YYYY E.g., Macro Express Pro - Explorer Document1 - Microsoft Word Moving mouse to window of running program - Macro Express Pro - Macro Express Forums - Mozilla Firefox Note the pattern at the end of each line is space hyphen space ProgramName So if you specify a partial match, do this: For Macro Express's Explorer: - Explorer For Microsoft Word documents: - Microsoft Word For Firefox: - Mozilla Firefox Check out the Help screen for Window Activate. Macro Express help screens are excellent... much better than most applications. Quote Link to comment Share on other sites More sharing options...
jsampsonyyyyy Posted June 15, 2016 Author Report Share Posted June 15, 2016 Many thanks. The window title is "tk" in this case. I have been investigating further. "Window Activate" and "Mouse Move" work better if confined to one monitor. I have a two-monitor setup which I suspect is a cause of problems. Quote Link to comment Share on other sites More sharing options...
acantor Posted June 15, 2016 Report Share Posted June 15, 2016 Are you able to find the "tk" on the list when you click the "Browse" button in the Window Activate dialog box? If the name does not appear on the list, it is invisible to Macro Express. Quote Link to comment Share on other sites More sharing options...
jsampsonyyyyy Posted June 15, 2016 Author Report Share Posted June 15, 2016 I found that 'mouse move' would not work. What did make it work was to select tkinter's console window. Although I have no command to select or deselect any window, "mouse move" seems to work only when this particular window is selected. The macro is: Mouse Move: 165, 67 Relative to Screen. Delay: 0.5 seconds. Mouse Left Click. Delay: 1 seconds. Nothing else. Activation is Ctrl+Alt+W. Scope is global. I closed the tk program to see what that did, but Mouse Move did not work. There was a momentary appearance of the circular blue progress icon. The macro behaves as if its scope is within tk. I have no time now but perhaps rebooting Windows will make it work. I suppose that is the next thing to try, but it would not solve how to make a useful macro. Regards John Sampson Quote Link to comment Share on other sites More sharing options...
jsampsonyyyyy Posted June 15, 2016 Author Report Share Posted June 15, 2016 I have found the answer, I think. I was running a program that has its own macro facility. Evidently if I use an activation key combination that it uses, that overrides any Macro Express macro. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.