|T O P I C R E V I E W
||Posted - 06/07/2019 : 01:53:56
I want mouse moves/clicks to the relative position of the current window.
In AutoHotkey, I can get the position(Left/Top x,y) and the size(Right/Bottom x,y) of the window I'm using. Thus, the mouse cursor can go to the relative position I want.
(How)Can I do that in S+?
Scenario: I want to close the download file message in the right/bottom corner of Google Chrome by clicking the "x" icon. But the size and position of Chrome may change sometimes.
|7 L A T E S T R E P L I E S (Newest First)
||Posted - 07/27/2019 : 06:36:04
Oh...You're right! I over-interpreted it.
Thanks for the correction!!!
||Posted - 07/27/2019 : 05:12:45
Regarding the width and height, not necessarily. It is simply the location of the right and bottom edges of the rectangle. Same with left and top, just the location of the edges.
If your screen location doesn't start at 0,0 then right and bottom won't be what you're assuming.
Width = right - left
Height = bottom - top
||Posted - 07/27/2019 : 01:37:45
Thank you! I finally understand these!!! It seems I keep making the same mistake forgetting to assign a variable to catch the return value. XD
acGetWindowLeft/Top will return respectively the x & y(which is the coordinate of the top/left most corner) of the current window &
acGetWindowRight/Bottom will return respectively the x & y(which is the coordinate of the right/bottom most corner) of the current window
, that is the same number of the size of it.
local yofTop = acGetWindowTop(nil, gsx, gsy)
local xofLeft = acGetWindowLeft(nil, gsx, gsy)
local xofRight (
width) = acGetWindowRight(nil, gsx, gsy)
local yofBottom ( height) = acGetWindowBottom(nil, gsx, gsy)
acMouseClick(xofRight-12, yofTop+95, 2, 1, 1)
||Posted - 07/22/2019 : 07:52:21
acGetWindowTop(nil, gsx, gsy) returns the top (y) coordinate part for the window location where the gesture started (gsx, gsy) [Gesture Start X / Y]
You have to assign the return value to something or nothing happens.
Something kind of like this:
local wndTop = acGetWindowTop(nil, gsx, gsy)
local wndLeft = acGetWindowLeft(nil, gsx, gsy)
acMouseClick(wndLeft-5, wndTop+95, 2, 1, 1)
I haven't tested this, but this is the general idea anyway, plus I'm not sure exactly which part of the coordinate you're trying to modify so my numbers (-5 and +95) might be swapped.
||Posted - 07/19/2019 : 23:53:21
Hi, I've read the help file and tried some commands but I can't get it to work. The mouse cursor goes nowhere.
And I stil don't understand what does it mean by "gets the handle of the window at the x and y coordinates." Which point/pixel on the top/right/bottom/left side?
Also, can I get the x coordinate from the right side and y coordinate from the top side at the same time?
acGetWindowTop(nil, gsx, gsy)
acMouseClick((gsx-5), (gsy+95), 2, 1, 1)
||Posted - 06/07/2019 : 12:25:59
Ok, I'll try to figure it out how to use them to achieve my goal.
||Posted - 06/07/2019 : 06:12:49
You can get the locations of each window edge using these: