lexikos wrote: ↑24 Sep 2022, 00:20
I do not recommend or support using a separate extension. You can obviously register whatever extension(s) you want, but you will have to do it manually. If you are doing that, you should probably avoid using the installer.
Although not recommended or supported, it is very doable.
I played around with v2 about two years ago but recently decided to try it again for real scripts that I use. I really like the more consistent syntax. It looks like it is just going to be better all round, once I get past the initial re-learning curve. I appreciate the work
@lexikos and other contributors have put into moving AHK into the future.
Also, SciTE4AutoHotkey was recently updated. So, I decided to do a clean new install of both AutoHotkey and SciTE4AutoHotkey. I had tinker with both in ways I probably do not even remember so I uninstalled and removed everything I could to try to get back to a clean slate.
I installed both as recommended. Everything seemed to work great. I really like the effort with the Dash and Launcher. Good to see effort being put into some of these supporting type programs to form a more complete package. Vanilla SciTE4AutoHotkey also seems to work pretty good except for no Calltip help for functions and commands. Also, miss not having the AutoComplete for variable names but that was a mod. But overall SciTE4AutoHotkey has had some pretty nice upgrades including more support for AHK v2. Hopefully the Calltip will get fixed as that was a real time saver as I often have to look up the parameters and order.
The Launcher is a pretty cool idea. I can see how it could really help with the adoption of v2 as everyone can have v1 and v2 both installed and then just download or copy code from the forum or wherever and AHK will use the right version to run it. And since most people would have both installed, posting v2 code would not seem like a barrier to using it. It makes for an easy gradual transition at a pace that is comfortable for both creators and users. Then at some point v2 would become the predominant version in an organic way.
As clever as the Launcher is, it does not handle this:
Code: Select all
Run Test.ahk,,,PID
MsgBox % PID
WinGetTitle, Title, ahk_pid %PID%
MsgBox % Title
Basically, because scripts are run through the launcher you do not get the PID of the actual script. At least not in my limited testing. This breaks a major script that I use extensively,
AKH Startup.
So, I had to resort to not using the Launcher and use separate extension for v1 and v2. I modified the Registry to support ahk and ah2 extensions with context menus for each which was not too hard. I added this to SciTE4AutoHotkey's ScitEUser.properties:
Code: Select all
file.patterns.ahk=*.ahk;*.ah2
file.patterns.ahk1=*.ahk
file.patterns.ahk2=*.ah2
ah2.file.extension=*.ah2
filter.ahk=\
AutoHotkey scripts (*.ahk)|$(ahk.file.extension)|\
AutoHotkey v2 scripts (*.ah2)|$(ah2.file.extension)|\
AHK scriptlets (*.scriptlet)|$(ahkscriptlet.file.extension)|
So far, I am very pleased with this slightly modified installation of AutoHotkey v1, v2 and SciTE4AutoHokey. Clean installs and about 15 minutes of manual tinkering will get two extensions working pretty well.
I don't know if there is any way to get the Launcher to report the PID of the script back to the Run command. I assume I could have the Run use a specific AutoHotkey.exe but that kind of defeats the purpose of having v1 and v2 intermingle without having to worry about which exe needs to run each. If I rewrite AHK Startup to v2, I will put some though into it.
Also, separate extensions do make organizing my files easier and different icons. Even with the benefits of separate extensions, I would probably use the Launcher and one extension if it did not break a major script I use.
FG