Page 1 of 1

AHK v2.0-beta.3 #SingleIntance not working if running two different versions of the .exe

Posted: 18 Jan 2022, 07:30
by Awesome Quest
If you run a script first with an older version of autohotkey and then a newer version, #SingleInstance doesn't work.

I use a basic .exe in the startup folder to run a script in the documents folder and recently reinstalled windows without losing files. Thus there was an old version of ahk v2 (2.0-a123-e5801ee8) in the startup folder but v2.0-beta.3 in the autohotkey folder.

I feel like this should be a bug. It was at least pretty confusing.

Re: AHK v2.0-beta.3 #SingleIntance not working if running two different versions of the .exe  Topic is solved

Posted: 18 Jan 2022, 11:45
by joefiesta
there is no bug.

The doc for #singleinstance, https://www.autohotkey.com/docs/commands/_SingleInstance.htm , states
AutoHotkey relies on the title of the script's main window to identify other running instances of the script.
The main window's title--well, maybe you can't see it if you open it and have stupid windows 10 which has no window titles--is, essentially the file's path with "- AutoHokey" and the version number appended. So, for two scripts to be "identical" they must have the same PATH, and be of the same AHK version.