acantor Posted May 9, 2010 Report Share Posted May 9, 2010 I know how to move the mouse cursor relative to the screen, and relative to the window. Is there a way to move it relative to the part of the window below all menus, toolbars, etc. Or should this be a feature request? Quote Link to comment Share on other sites More sharing options...
rberq Posted May 10, 2010 Report Share Posted May 10, 2010 The only way I know to move it is to specific x- and y-coordinates. If you need to adjust for multiple users who format their menus and tool bars differently, then maybe you can find some attribute on the screen that give you an adjustment factor. For example, I have macros for a web-based application used by dozens of PCs, and the initial window has a blue band across the top about 80 pixels from top to bottom. So I scan downward from the top of the screen looking for that color, make sure the next 80 pixels downward are the same color, and record the y-coordinate where the first blue pixel was found. After that, all mouse movements are window-relative plus or minus the band factor. Quote Link to comment Share on other sites More sharing options...
acantor Posted May 10, 2010 Author Report Share Posted May 10, 2010 I was hoping to avoid pixel sniffing to do this! There are too many ways that my users set up their systems. I am scripting for a web app running in IE, and recently discovered that some users display the History pane, which means that I can't be hunting for pixels on the left side of the screen. The solution I may use is to hunt for ten consecutive pixels of the predominant background colour in the lower right corner of the screen. I think I am going to put in a feature request... Quote Link to comment Share on other sites More sharing options...
paul Posted May 10, 2010 Report Share Posted May 10, 2010 I think I am going to put in a feature request... But what is the feature you're requesting? If it's to find 10 consecutive pixels of a specified colour, you can already do that with the commands provided by constructing a simple Repeat loop. Surely new features are to be requested only if there's something you cannot already do in MEP? Or something that takes a lot of code to achieve. Quote Link to comment Share on other sites More sharing options...
terrypin Posted May 10, 2010 Report Share Posted May 10, 2010 The solution I may use is to hunt for ten consecutive pixels of the predominant background colour in the lower right corner of the screen. You might also be able to incorporate the <Ctl+Sh+h> toggle to momentarily switch off the History pane. I think I am going to put in a feature request... Re Paul's point, my trusty Stiletto power utility appears to display relative positions within panes, so there might well be scope for a new feature in ME Pro. In this example, note that the screen positions (located at the bottom right corner of the yellow Stiletto pop-up) are identical, but the window-relative positions are Stiletto: 122,354 ME Pro: 396, 497 FWIW, I've frequently had problems when using the window-relative option on complex windows with several types of pane. It seems that 'relative to window' does not always mean 'relative to the top left corner of the currently active main window' in ME Pro. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
acantor Posted May 10, 2010 Author Report Share Posted May 10, 2010 I've made a feature request. One of the scripting tools that I use (NaturallySpeaking Advanced Scripting) has a command to position the mouse cursor relative to the active window. It's convenient to NOT have to kludge something together every time! Anybody know of a programmatic way to determine whether the History pane is on or off? I tried several approaches based on pixel colour or mouse cursor detection, but these techniques are not reliable enough. What would be ideal is a way to do this programmatically. Where does IE store user-specific settings? And can these settings be directly read (and written) by Macro Express? Quote Link to comment Share on other sites More sharing options...
Cory Posted May 10, 2010 Report Share Posted May 10, 2010 Is there a way to move it relative to the part of the window below all menus, toolbars, etc.Yes, Mouse Move > Relative to Control. At least that works for me. Quote Link to comment Share on other sites More sharing options...
acantor Posted May 10, 2010 Author Report Share Posted May 10, 2010 Yes, Mouse Move > Relative to Control. At least that works for me. Hi Cory, This can work, and in fact, I tried the approach yesterday. But it fails when the active window does not have focus. If the user has inadvertently shifted keyboard input focus to a menu or "ribbon" -- which I observe often, especially when a user inadvertently presses Alt or is clicking around the screen -- the command does not work. Quote Link to comment Share on other sites More sharing options...
Cory Posted May 12, 2010 Report Share Posted May 12, 2010 Can't the window or control be re-focused? Quote Link to comment Share on other sites More sharing options...
acantor Posted May 12, 2010 Author Report Share Posted May 12, 2010 Can't the window or control be re-focused? I'm not sure... but maybe I am asking too much. A lot of macros -- and not only those developed by me -- can fail when the user inadvertently messes with the focus. Quote Link to comment Share on other sites More sharing options...
Cory Posted May 12, 2010 Report Share Posted May 12, 2010 But if you focus it immediately before the click it should work. Quote Link to comment Share on other sites More sharing options...
acantor Posted May 13, 2010 Author Report Share Posted May 13, 2010 But if you focus it immediately before the click it should work. Sounds intriguing. Now sure I know how to do this. Let's say I have any old IE window open. I want to click in the upper left hand corner of the active window, say at (1,1). When I invoke the command, focus may be within the active window, in the Search box, on the menu bar, or in the History pane. How can I put focus in the active window, without clicking -- because I don't want to inadvertently click a link, button, etc. -- and without sending a series of Tabs -- because I can't know how users have configured their browsers, with extra toolbars, etc. that throw off the Tab order. Quote Link to comment Share on other sites More sharing options...
kevin Posted May 13, 2010 Report Share Posted May 13, 2010 How can I put focus in the active window, without clicking Try the Window Activate command. To speed up my macros I check to see if it already has focus: If Not Window " - Macro Express Forums - Mozilla Firefox" is focused Window Activate: - Macro Express Forums - Mozilla Firefox End If Quote Link to comment Share on other sites More sharing options...
Shiny Posted December 21, 2011 Report Share Posted December 21, 2011 I was doing a google search and a forum search and this thread is exactly what I was looking for. I wish Macro Express Pro would have this option Relative to user defined coordinate. The relative to control have very limited options, like get mouse position does not have relative to control. With relative to user defined coordinate, Macro Express Pro would be a lot more flexible to work with. Quote Link to comment Share on other sites More sharing options...
terrypin Posted December 21, 2011 Report Share Posted December 21, 2011 I was doing a google search and a forum search and this thread is exactly what I was looking for. I wish Macro Express Pro would have this option Relative to user defined coordinate. The relative to control have very limited options, like get mouse position does not have relative to control. With relative to user defined coordinate, Macro Express Pro would be a lot more flexible to work with. I see Alan requested it 18 months ago... -- Terry, East Grinstead, UK 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.