0

I want to do something like..

position := [100, 200]
Click, position[1], position[2]

but the above doesn't work, no error, but doesn't do click

Click, %position[1]%, %position[2]%

above gives error, variable name contains an invalid character

position := [100, 200]
p1 := position[1]
p2 := position[2]
Click, %p1%, %p2%

above works, but I don't want to assign dummy variables each time I need to click..

any help? thanks!

1 Answer 1

1

This will do what you want:

click % position[1] . "," . position[2]

The % must be followed by a space or tab. It causes the command to use expression mode.

More information on "expression mode" can be found under Help > Variables and Expressions > Variables > Retrieving the contents of variables.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks again! You must be the AHK master :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.