I want to use the FindClick function, but instead of writing all path and image name, I would like to pass a variable containing that info but all my attempts end with an error message saying "The following variable contains an illegal character".
I know I'm missing the quotes, but my idea is something similar to:
Path = D:\Documents\AutoHotkey\Pictures\
Match = %Path%Image.png
FindClick(%Match%)
Thank you for your help
FindClick Pass a Variable Topic is solved
Re: FindClick Pass a Variable Topic is solved
No % signs in expressions (normally), which function parameters always are. So to pass the value of your variable, it would be:
or using all expressions:
The reason for the error message you received is that you tried to pass the value of a variable named D:\Documents\AutoHotkey\Pictures\Image.png, which can't be a variable name because it contains unallowable characters. It might help you to understand with this working example that implements a double-deref (or it might confuse you more):
Code: Select all
Path = D:\Documents\AutoHotkey\Pictures\
Match = %Path%Image.png
FindClick(Match)
Code: Select all
Path := "D:\Documents\AutoHotkey\Pictures\"
Match := Path . "Image.png"
FindClick(Match)
Code: Select all
Path := "D:\Documents\AutoHotkey\Pictures\"
Match := Path . "Image.png"
Var := "Match"
FindClick(%Var%)
Re: FindClick Pass a Variable
Thank you very much for your answer.
I wouldn't let the opportunity to pass without congratulating you on your outstanding work and helping many people.
Thanks!!!!!
I wouldn't let the opportunity to pass without congratulating you on your outstanding work and helping many people.
Thanks!!!!!