Issue with simple script mouse click script (Autokey) - coordinates

I am using a gis software that has 2 windows, I have window A opened in my primary monitor and window B opened in the secondary monitor.
I am trying to make a script that will move the mouse to the secondary monitor and left click a certain position.
I tried to do it this way:
+z::
Click, 630 74 1
Problem is that when I am using the mouse in the window A, then when I use the script it will move to a position of the primary monitor.
Would it be possible to fix this by using the window title (which is different) in order to make the script go to window B before clicking?
Thank you

Related

Exiting out of a running Python script when script window is hidden

I have a Python script written using Visual Studio Code that periodically moves the mouse icon to keep the computer active and stop it from falling asleep. This computer is used for displaying other info, so when the program is running the script window is minimized and another window is selected and opened and then the computer is left alone. When I want to use the computer again the Ctrl+C keyboard interrupt to terminate the script does not work unless the script window is reopened. This proved to be annoying as the script takes control of the mouse away from the user. I have a 'time.sleep' command that pauses the mouse movement to allow for user control again for a bit, but I would like to be ab le to just exit the script without having to wait for this pause to be able to open up the script window.
I am fairly new to Python, so I am unsure of other commands or keyboard inputs that might allow this to be possible.
The code I have does utilize the pyautogui module and has the default failsafe of moving the mouse icon to the corner of the screen enabled. However, this still requires me to wait for the pause in the script when I have control of the mouse again.
This is for a Windows environment.
If you are using pyautogui, just quickly move your mouse to the top left corner of the screen and your program will stop

Autoit MouseClick - click does not work on Connection Bar in RDP window

I am trying to minimize RDP window by using Autoit mouse functions
First MouseMove to correct location -> hint "Minimize" appear
but then MouseClick (or mousedown, sleep, mouseup) seems do click "through" connection bar , as I see icon on desktop under the connection bar got focused.
I thought before, any mouse action "by hand" can be imitated , but I am stuck here...
To fix this problem, you need to do one of the following:
Run the program on the remote computer - then you can use the "standard" AutoIt functions
Run the program on the local computer, and analyze the remote image with ImageSearch UDF or OpenCV UDF and click in the selected point of screen.

Access the MDI toolbar menu with AutoHotKey ControlSend

Automating a process that is being run on a RDP session, I have to use ControlSend, and not Send command in AutoHotKey.
The WindowSpy doesn't find any control on the MDI toolbar, and there are no shortkey to the menu item I want to access (Filter..). How may I open the toolbar and select the item?
I've tried
ControlSend, ahk_parent, {alt}, ahk_class FNWND3170 ;Open project folder in treeview
But with no success.
I've considered using AutoIT, but I don't think that would help as the AutoIt spy doesn't pick up the control either.
Sorry, but think of the RDP window (or even full screen) as an ever-evolving bitmap image. Your PC and autohotkey have no idea what is behind the picture. Can you run the ahk script in the remote pc itself? Keep in mind, the RDP client handles your mouseclicks and keyboard (and even voice) entirely by re-directing inputs, etc. So best bet is to do a mouse click in the appropriate spot by running a script from outside the window:
CoordMode, TargetType [, RelativeTo]
Click, 44, 55 ; Clicks the left mouse button once at coordinates 44, 55 (based on CoordMode).
Use the CoordMode "RelativeTo" flag to set to "Relative" so coordinates are relative to the active window. You may have to click twice, once to activate the RDP window and then to click at the mouse position.
See https://www.autohotkey.com/docs/commands/Click.htm and https://www.autohotkey.com/docs/commands/CoordMode.htm for info.
Hth,

Automatic clicking on java program buttons

So I need to automate some button clickings on a java program. I tried ahks/autoit's controlclick but it doesn't really work (normal clicks do work, but I require no mouse movement).
I tried to get some information from window detective / window spy, etc. but not much is displayed apart from the window name and ahk_class
Java Ferret shows quite a lot more information though: https://gyazo.com/3539415488ce3e03c90f3532327419f2
How can I trigger one of these "push button" actions? (say "Descendent 19 role")
If you can get the X and Y coordinates of the control along with the window name, you could use a mouse click event.
Other than that, you can try using an image search to find the control's X and Y and perform a mouse click.

PowerShell Control Where CMD Window is Displayed

Problem
My PowerShell script generates a Form Window (with a fix startup location) and has a CMD Prompt window that is displayed alongside it that is used to display certain actions. However, with each successive launch of the PowerShell script, even though the Form Window stays in one place, the CMD Prompt window moves lower and lower as it makes its way systematically to the center of the screen. Once it reaches the center of the screen, it resets its position to the top left corner of the screen, only to repeat the process all over.
Question
Is it possible to designate the starting position of CMD Prompt Window, like you can with the Form window, so that I have more control over it?