Click doesn't work with variables
Posted: 20 Feb 2020, 10:20
This code works:
This code does not work. The click never happens. I have logged PsX and PsY to a file, and those variables contain the correct values.
I am basing my syntax on the help page for click where it says: "Click, %x%, %y% Since click does not support expressions, variables should be enclosed in percent signs."
I also tried it this way:
In this case I did not use the % around variables since the help for MouseMove says "The x/y coordinates to move the mouse to, which can be expressions"
Still, the mouse does not move, and the click does not happen.
What did I miss?
Code: Select all
Click 300,575
Code: Select all
PsX := GPwidth // 2 ; middle from left
PsY := ( GPheight - 17) ; from bottom
Click %PsX%, %PsY%
FileAppend, %A_YYYY%-%A_MM%-%A_DD% -------------- Click X:%PsX% Y:%PsY%`n, C:\data\ahk-log.txt
I also tried it this way:
Code: Select all
PsX := GPwidth // 2 ; middle from left
PsY := ( GPheight - 17) ; from bottom
MouseMove PsX, PsY
Click
FileAppend, %A_YYYY%-%A_MM%-%A_DD% -------------- Click X:%PsX% Y:%PsY%`n, C:\data\ahk-log.txt
Still, the mouse does not move, and the click does not happen.
What did I miss?