Things with screen dont work

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jakobura

Things with screen dont work

19 Jan 2018, 15:54

Hi guys i have some problems with ahk

First of all, when I use this script:

Run, calc.exe
WinWait, Calculator
WinMove, 0, 0

the calculator will open but it dont move to the correct position

Secoundly, when I use this script

MouseMove, 200, 100

the mouse will move to the upper left corner of my screen but not here where it should go

I am quite sure that it is not a coincidence that both of them dont work correctly, it is possible that the problem is connected with the fact that i have 3 monitors

Thanks for your help(sorry for my bad english :oops: )
User avatar
TrippyHippyDan
Posts: 10
Joined: 16 Jan 2018, 10:48

Re: Things with screen dont work

19 Jan 2018, 16:27

@jakobura

For your first issue this should work for you. I have found being more specific helps especially in windows 10.

Code: Select all

SetTitleMatchMode, 2
Run, calc.exe
IfWinNotActive, Calculator, , WinActivate, Calculator, 
WinWaitActive, Calculator, 
WinMove, Calculator, , 0, 0,
Sleep, 60
User avatar
TrippyHippyDan
Posts: 10
Joined: 16 Jan 2018, 10:48

Re: Things with screen dont work

19 Jan 2018, 16:31

@jakobura

For the second issue in your script are you looking to move the mouse that distance or to those co ordinance? Also did you define in the script to run off the application or the screen itself using CoordMode?
User avatar
boiler
Posts: 17065
Joined: 21 Dec 2014, 02:44

Re: Things with screen dont work

19 Jan 2018, 16:32

First issue: It should also work just to add WinWaitActive without having to do the if first.

Second issue: Set CoordMode correctly. Default is relative to the active window.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot] and 338 guests