Live data from Hacker News

AutoHotKey V2 (Breaking Upgrade)

autohotkey.com

41–50 of 124 posts

Re: AutoHotKey V2 (Breaking Upgrade)

#41
post #16

This is a bit of a PITA for me as most people use AHK to handle shortcuts for komorebi[1], which led to me generating an AHK library[2] to help people write their configs. Turns out every single line of that generated library (not to mention the entire sample config for newcomers) is now invalid syntax in v2. I'm taking a month off from development while I'm traveling, maybe I'll feel less salty about this when I get…

I have been coding with v1 for about 15yrs and switched to v2 in a heartbeat.

But I would definitely not recommend converting v1 scripts to v2 if is not absolutely necessary.

You can have both installed and work great with the new launcher that auto selects version based on the #Requires directive.

I would definitely not convert v1 scripts that are longer than 2k lines.

What I have found is that re-writing stuff for v2 is WAY easier than converting.

You might also try the v1 -> v2 converter by dimitri. It is not perfect but does 90% of the work for ya.

Re: AutoHotKey V2 (Breaking Upgrade)

#42
post #16

This is a bit of a PITA for me as most people use AHK to handle shortcuts for komorebi[1], which led to me generating an AHK library[2] to help people write their configs. Turns out every single line of that generated library (not to mention the entire sample config for newcomers) is now invalid syntax in v2. I'm taking a month off from development while I'm traveling, maybe I'll feel less salty about this when I get…

Can you just specify AHK1 for users for the time being? Is there an equivalent of a shebang, differentiator, or something in AHK scripts that'd allow a simultaneous v1 and v2 install? When Python went from 2.x to 3.0, there wasn't some expectation that all adoption of breaking changes happen immediately - one hopes similar provisions have been made here.

we have the #Requires directive

e.g.: #Requires Autohotkey v1.1.36+ 32-Bit

When you install v2 it has a launcher that can be configured and runs scripts with the correct interpreter based on that directive.

If that directive is not in the script it would try to determine the version based on syntax. And if it couldnt determine it, it would ask you what to do.

I have both versions installed and have had no issues as of yet.

Re: AutoHotKey V2 (Breaking Upgrade)

#43
post #13

AHK is what keeps me on Windows

On MacOS there's a few options: Keyboard Maestro, BetterTouchTool, Karabiner, Hammerspoon.

Most of them aren't free and I haven't found any of them to be better than AHK, but they do the job well enough that it's certainly not a reason to look back fondly to Windows despite my lack of enthusiasm for MacOS.

Re: AutoHotKey V2 (Breaking Upgrade)

#44

I'm surprised no one has mentioned this; AHK broke compatibility with this upgrade. I tried upgrading autohotkey and it braked my scripts. It seems to have an auto-regress feature, which is nice. If someone knows where there is a comprehensive this-for-that upgrade guide, that would be nice; I didn't see such a thing on the site.

you can have v2 and v1 installed and running at the same time. I dont see any issues with the newest version :)

Re: AutoHotKey V2 (Breaking Upgrade)

#45
post #7

As someone who has been using Macs since 2006 and recently moved to Windows, I cannot recommend AHK enough.

I only have a single AHK script (I don't use windows much) and it specifically maps WinKey + Q to close a window and WinKey + H to hide a window. Windows is basically unusable for me without this convenience script!

Re: AutoHotKey V2 (Breaking Upgrade)

#46

I'm surprised no one has mentioned this; AHK broke compatibility with this upgrade. I tried upgrading autohotkey and it braked my scripts. It seems to have an auto-regress feature, which is nice. If someone knows where there is a comprehensive this-for-that upgrade guide, that would be nice; I didn't see such a thing on the site.

Did you see https://www.autohotkey.com/docs/v2/v2-changes.htm?

Re: AutoHotKey V2 (Breaking Upgrade)

#47
post #44

I'm surprised no one has mentioned this; AHK broke compatibility with this upgrade. I tried upgrading autohotkey and it braked my scripts. It seems to have an auto-regress feature, which is nice. If someone knows where there is a comprehensive this-for-that upgrade guide, that would be nice; I didn't see such a thing on the site.

you can have v2 and v1 installed and running at the same time. I dont see any issues with the newest version :)

I don't now. I had updated AHK through `scoop`, and saw the pop-up about downloading a previous version which I didn't understand at the time. Then proceeded to find that my scripts were broken, went to the AHK site and saw the V2 info. I played with updating my script for a little, then postponed it and let AHK regress for now. I was then surprised when I searched HN and found no post about the update, so decided that I would let everyone here know what was afoot.

Re: AutoHotKey V2 (Breaking Upgrade)

#48
I'm still reading through the changes ( https://www.autohotkey.com/docs/v2/v2-changes.htm ), but I like what I'm seeing so far. So many (many many) quirks and special cases are just gone now, I suspect users will find it much faster to learn and easier to avoid getting stuck on odd burrs on every corner.

I learned programming with AHK back before data structures like maps and arrays even existed (!), and I'm happy to see it's still getting better. I still use a few utilities that I built on a daily basis.

Re: AutoHotKey V2 (Breaking Upgrade)

#49
post #45
post #7

As someone who has been using Macs since 2006 and recently moved to Windows, I cannot recommend AHK enough.

I only have a single AHK script (I don't use windows much) and it specifically maps WinKey + Q to close a window and WinKey + H to hide a window. Windows is basically unusable for me without this convenience script!

For me it was the CMD+` for cycling between windows of the same Application, can't live without it.

Do mean "hide a window" just the CMD+H in macOS? How did you do it?

Post reply on HN