acantor Posted August 12, 2019 Report Share Posted August 12, 2019 I am having a problem with a simple script that moves the mouse cursor to the upper right corner of the current window: Variable Set Integer %x%: Set to the Current Window's Width Variable Set Integer %y%: Set to the Current Window's Top Mouse Move: %x%, %y% Relative to Current Window Mouse Move: -10, 10 Relative to Last Position // Nudge the mouse pointer a little so that it is visible in maximized windows <VARIABLE SET INTEGER Option="\x0A" Destination="%x%"/> <VARIABLE SET INTEGER Option="\x08" Destination="%y%"/> <MOUSE MOVE Option="\x02" X="%x%" Y="%y%" _PROMPT="0x000A"/> <MOUSE MOVE Option="\x03" X="-10" Y="10" _PROMPT="0x000A" _COMMENT="Nudge the mouse pointer a little so that it is visible in maximized windows"/> The script works in maximized windows, and also in windows that are clinging to the top of the screen. In other situations, for example, if I resize the window so that it is centred in the middle of the screen, the mouse cursor is correct for the x coordinate, but not the y coordinate. The error seems to be proportional, or at least related, to the distance of the top of window from the top of the screen. Can anyone confirm this behaviour? Or is there a flaw in my script? Quote Link to comment Share on other sites More sharing options...
terrypin Posted August 12, 2019 Report Share Posted August 12, 2019 Alan, I got same behaviour on the couple of tests I had time for (Firefox and a folder). Strange. Speculative, but may be related to the other mouse cursor issue we were discussing? -------------------- EDIT at 08:40 Scrub that speculation! It's because the macro logic is wrong! The following does the job: Variable Set Integer %x%: Set to the Current Window's Width Mouse Move: %x%, 0 Relative to Current Window Mouse Move: -10, 10 Relative to Last Position // Nudge the mouse pointer a little so that it is visible in maximized windows <VARIABLE SET INTEGER Option="\x0A" Destination="%x%"/> <MOUSE MOVE Option="\x02" X="%x%" Y="0" _PROMPT="0x000A"/> <MOUSE MOVE Option="\x03" X="-10" Y="10" _PROMPT="0x000A" _COMMENT="Nudge the mouse pointer a little so that it is visible in maximized windows"/> 1 Quote Link to comment Share on other sites More sharing options...
acantor Posted August 12, 2019 Author Report Share Posted August 12, 2019 Thank you, Terry! You solved the mystery. I was on the verge of reporting this to Insight as a bug, when the real bug was in the software between my ears... Quote Link to comment Share on other sites More sharing options...
rberq Posted August 12, 2019 Report Share Posted August 12, 2019 I have a similar macro, but it does only a single mouse move instead of two. That is, calculate the intended mouse destination BEFORE moving. I wonder if moving to the extreme limit of the window, rather than safely within the limits, might sometimes be a problem. // .... click on X at upper right of window Variable Set Integer %N30% from Width of Window Variable Modify Integer: %N30% = %N30% - 14 Mouse Move Window %N30%, 9 Mouse Left Button Click 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.