Code: Select all
DetectHiddenWindows, On
DetectHiddenText, On
SetTitleMatchMode, 2
#If !WinExist("%UserProfile%\Dropbox\AutoHotkey Automation Scripts\Look Up Words.ahk")
F3::
Run %UserProfile%\Dropbox\AutoHotkey Automation Scripts\Look Up Words.ahk
Return
#If
But now, I've moved computer, and my user name changed. To future-proof the script against future moves, I've decided to change all the hard path to variable path as such. After the change, the script no longer work!
Curiously enough, the "Run" command works fine. It managed to load out the correct script. It's only the "WinExist" command that's giving me trouble.
Is there a way to fix this? Or do I have to put up with using the hard path ?