RobRif Posted April 15, 2021 Report Share Posted April 15, 2021 I have a daughter window with a title "Filter" (see attached image) with several drop down lists/menus to select. I need to position the cursor accurately to select each list but this daughter window "Filter" does not show up on the list of windows in the mouse move command where you can specify a window for cursor positioning or in the size or position browse lists these commands. Is there any way I can get Macro Express Pro to recognize the daughter window so I can position a cursor in various places within that window? Thanks for any suggestions. Bob Rifkin Filter.docx Quote Link to comment Share on other sites More sharing options...
acantor Posted April 15, 2021 Report Share Posted April 15, 2021 Can you interact with the "Filter" window using the keyboard? If the screen is keyboard accessible, you may have a much easier time controlling the "Filter" window via Macro Express. A few specific questions: When "Filter" first opens, which control has focus? I would assume "Mode," but maybe not. Can you navigate from control to control by pressing Tab or Shift + Tab? Can you reach the buttons marked "..." by pressing Tab? When these buttons have focus, does pressing spacebar or Enter generate the list of options? Is it OK to simply type the option into a field instead of choosing it from a list? Can you cause a drop down list to open by pressing Alt + down, Alt + up, or F4? Quote Link to comment Share on other sites More sharing options...
rberq Posted April 15, 2021 Report Share Posted April 15, 2021 IF the daughter window always appears at the same location on the screen, you can move the mouse relative to screen rather than relative to window. If the daughter window can be moved around, the macro could conceivably grab it with the mouse and slide it to the top left of the screen -- again you could then move the mouse relative to screen. But I'm with acantor here -- if you can navigate the window via the keyboard, you will probably improve reliability and reduce headaches. Quote Link to comment Share on other sites More sharing options...
RobRif Posted April 16, 2021 Author Report Share Posted April 16, 2021 Thanks to both responses. In response to rberg, the dsughter window does not always open in the same exact place of size, that is what caused my problem in the first place. I was using screen relative positions for the cursor location. So cursor locations relative to screen or window do not always stay the same. A kluge I am using is to manually move the window as far as possible up and to the left, this seems to be a fixed location on the screen , then I can use screeen relative mouse location, that seems to work since I can position the mother window within the screen with Macro Express. But it is clumsy and requires at least one manual mouse action. In response to acantor, yes I can navigate on the Filter window with keyboard for some things, not sure if it can work for everything but I will try that out. Of course, it will require initial manual placement of the cursor within the first field of the Filter window. That might work OK. It is just odd that Macro Express does not seem to reccognize the Filter window and allow cursor movement relative to it. I had hoped there was some way to get it to do that. I've read about "controls", I don't think that will accomplish the goal. I appreciate the time both of you have taken to assist me, many thanks. Quote Link to comment Share on other sites More sharing options...
rberq Posted April 16, 2021 Report Share Posted April 16, 2021 1 hour ago, RobRif said: A kluge I am using is to manually move the window as far as possible up and to the left, this seems to be a fixed location on the screen If you are manually moving the window, then perhaps the macro can move it -- not by repositioning commands, but by locating the top margin of the daughter window, then mouse-left-button-down a little below the margin, then mouse move upward and leftward, then mouse-left-button-up. Check out "If Mouse Cursor" in the Logic commands -- you can move the mouse down a few pixels at a time, checking for a change in the pointer as it moves over boundaries and over icons. Quote Link to comment Share on other sites More sharing options...
acantor Posted April 17, 2021 Report Share Posted April 17, 2021 Does "Snap" work on the Filter window? That's Windows + left arrow and/or Windows + right arrow. If yes, that might be another way to move the window to a predictable location. Although I've never tried, I imagine sending these keystrokes to the window might be very easy. Quote Link to comment Share on other sites More sharing options...
RobRif Posted April 17, 2021 Author Report Share Posted April 17, 2021 Thanks again to the last 2 suggestions. I will try the mouse dragging approach, the title bar for the daughter window is a big target and I might be able to use a screen location to grab that, even if it moves slightly, and then drag it left and up to the corner of the mother window as you suggested. That could make the Macro more fully automated and eliminate the manual first action I now need. I tried "Snap", it was a good suggestion, but unfortunately it doesn't work in this case. Thanks again for your time and thought on this Macro. Bob Quote Link to comment Share on other sites More sharing options...
rberq Posted April 18, 2021 Report Share Posted April 18, 2021 2 hours ago, RobRif said: the title bar for the daughter window is a big target and I might be able to use a screen location to grab that, even if it moves slightly . If you know approximately where the daughter window is, even if it moves slightly, you can search for the title bar by color. The logic below searches downward, 8 pixels at a time, looking for a type-in field that is a particular shade of gray. It is much faster to search in 8-pixel increments, instead of pixel-by-pixel, and 8 pixels is enough precision for the field I am looking for. If the Repeat loop "expires" without a color match, an error is displayed and the macro ends. If the expected color is found, the mouse is placed a few pixels further down, so as to be well within the field. // Find the type-in area by color Variable Set Integer %xc% to 300 Variable Set Integer %yc% to 100 Repeat Start (Repeat 150 times) Get Pixel Color at (%xc%, %yc%) Relative to Screen into %color% If Variable %color% Equals "4343115" Repeat Exit Else Variable Modify Integer: %yc% = %yc% + 8 End If End Repeat If Variable %color% Equals "4343115" Else Text Box Display: Diagnostics // Display error Macro Return End If Variable Modify Integer: %yc% = %yc% + 15 Mouse Move: %xc%, %yc% Relative to Screen // Place mouse down a little from the top edge of the entry field 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.