As far as I know, there is no spread syntax in AHK, but there are alternative methods:
For larger arrays, you can utilize:
position := [A_ScreenWidth / 2, A_ScreenHeight]
Loop,% position.Count()
MsgBox % position[A_Index] ; display a message box with the value
or
position := [A_ScreenWidth / 2, A_ScreenHeight]
For index, value in position
MsgBox % value ; display a message box with the value
In your scenario, it can be:
position := [A_ScreenWidth / 2, A_ScreenHeight]
MouseMove, position[1], position[2]
This action will move your mouse to the center of the bottom of your screen.
To avoid decimals, you can use Floor()
, Round()
, Ceil()
functions, for example:
position := [ Floor( A_ScreenWidth / 2 ), Round( A_ScreenHeight ) ]
Loop,% position.Count()
MsgBox % position[A_Index] ; display a message box with the value