Live data from Hacker News

AutoHotkey v2 Official Release Announcement

autohotkey.com

21–30 of 153 posts

Re: AutoHotkey v2 Official Release Announcement

#21
I recently updated my scripts to work with ahkv2. https://github.com/EBADBEEF/ahkv2-scripts

Some things I'm proud of here:

  - easy debug console (https://github.com/EBADBEEF/ahkv2-scripts/blob/main/Autostart.ahk#L4)
  - compose keys (to type keys like "¿ é ü" easily). Includes libX11 key database parser
  - window move and resize with mouse
I love AutoHotkey's documentation. It is an old school windows help file (chm) and it works really well. All my scripts run in an AutoHotKey process that takes less than 2MB of ram and provide great value to me.

Re: AutoHotkey v2 Official Release Announcement

#22
post #9

The scripting language for version 1 was pretty terrible but having messed with version 2 for a while now I'd say it's pretty decent.

I have a not-too-long list of keybinds that's currently on v1. Would you mind taking a look and letting me know if anything's not v2 compatible? [0] I don't think anything is that complicated, there's a loop or two although tbh those were more one-time-use things I haven't bothered to get rid of, in part so I have the syntax there as a reference in case I need it again. I do remember reading something about SetTitleM…

I'm not an expert, but these are basically the changes I would see that need to happen:

All of the places where you use commands no longer need a preceding comma:

    Run, Calc.exe
This is now just:

    Run "Calc.exe"
Similarly, all areas where you use strings now need to be quoted:

    Send, https://discord.gg/6SNQ4c6
Will now have to be:

    Send "https://discord.gg/6SNQ4c6"
AFAIK the area where you use "blocks" of code like this:

    ^!+x::
        ... stuff ...
Will now have to be enclosed in curly braces:

    ^!+x:: {
        ... stuff ...
    }
Where you use special constant/strings for the "Send" command now needs to use regular strings:

    Send "+{Tab}+{Tab} {Space} {Esc}"
Where you do an "if" condition like this:

    IfWinNotExist ahk_class MozillaWindowClass
        return
Will have to turn into something like:

    if (not WinExist("ahk_class MozillaWindowClass")) {
        return
    }
A full list of the differences is available at https://www.autohotkey.com/docs/v2/v2-changes.htm

Re: AutoHotkey v2 Official Release Announcement

#23
post #12

Autohotkey is awesome and special, and everybody on Windows should learn it. There is no such thing on any other OS. v2 syntax and features are so much better. It was basically in development for a decade and AHK itself more then 20 years.

macOS has AppleScript that does the same thing, and it’s built into the OS. https://developer.apple.com/library/archive/documentation/Ap...

ApppleScript was an amazing foundational part of what made the Mac so great, but unfortunately Sal Soghoian was pushed out of Apple, the Mac automation team ended, and the new future of Mac automation is an iOS application. It’s by no means dead, but it’s absolutely a zombie at this point, shuffling along until Apple inevitably depreciates it out of it’s usefulness.

I actually think AHK has the better model here. It takes low level windows functions and presents them in a fairly simple and low friction way. MS could never end AHK without also breaking an unfathomable number of other applications.

Re: AutoHotkey v2 Official Release Announcement

#24
I love Autohotkey because, in addition to its productivity benefits, it's a defensive tool against dark patterns imposed by user-hostile companies.

For example, I've been using it for years to enter my Runescape password [1] due to Jagex being clueless about security [2]

[1] https://reddit.com/r/runescape/comments/gxapao/how_to_paste_...

[2] https://www.troyhunt.com/the-cobra-effect-that-is-disabling/

Re: AutoHotkey v2 Official Release Announcement

#25

Earlier quoted context omitted.

I have a not-too-long list of keybinds that's currently on v1. Would you mind taking a look and letting me know if anything's not v2 compatible? [0] I don't think anything is that complicated, there's a loop or two although tbh those were more one-time-use things I haven't bothered to get rid of, in part so I have the syntax there as a reference in case I need it again. I do remember reading something about SetTitleM…

I'm not an expert, but these are basically the changes I would see that need to happen: All of the places where you use commands no longer need a preceding comma: Run, Calc.exe This is now just: Run "Calc.exe" Similarly, all areas where you use strings now need to be quoted: Send, https://discord.gg/6SNQ4c6 Will now have to be: Send "https://discord.gg/6SNQ4c6" AFAIK the area where you use "blocks" of code like this:…

oh wow, that's a pretty comprehensive set of changes, thanks for the reply! I'll procrastinate on this a bit then, it looks like it'll be closer to an hour than five minutes, although not too bad simply because it's not that big a file.

Re: AutoHotkey v2 Official Release Announcement

#26
I saw there's a python library that just lets you write autohotkey scripts in actual python code. I'd rather try that if I was going to rewrite my v1 scripts. AHK is awesome but the scripting language was never good. The new one looks like it has some better syntax, but native python support would be a much better solution for a lot of people.

Re: AutoHotkey v2 Official Release Announcement

#27

I saw there's a python library that just lets you write autohotkey scripts in actual python code. I'd rather try that if I was going to rewrite my v1 scripts. AHK is awesome but the scripting language was never good. The new one looks like it has some better syntax, but native python support would be a much better solution for a lot of people.

I wrote MicroKeys[1] out of a similar frustration. Granted, I never got past the POC stage, so it's not as feature rich as AHK, but it solved a very specific itch I had. I debate if I should flesh it out further, or try using AHK again.

[1] https://github.com/seligman/microkeys

Re: AutoHotkey v2 Official Release Announcement

#29

I saw there's a python library that just lets you write autohotkey scripts in actual python code. I'd rather try that if I was going to rewrite my v1 scripts. AHK is awesome but the scripting language was never good. The new one looks like it has some better syntax, but native python support would be a much better solution for a lot of people.

Why? The AHK python library isn't going to be so cleanly abstracted so that a different automation engine (eg hammerspoon w/ lua on macOS) can be plugged in, so the code is always going up be tightly coupled to AHK, and Python support is likely to be second-class to support for its own language. So other than some obsessive need to standardize on a single language which will never be won, what does Python buy?

Re: AutoHotkey v2 Official Release Announcement

#30
AutoHotkey was a lifesaver for me when I used to work on Windows. Universal CapsLock VIM movement keys, app-specific shortcuts, clipboard manipulation, text expansion, autocorrect. It really is an amazing tool. For mac, I've been able to cobble together a mix of karabiner, phoenix, and espanso to do all of what just AutoHotkey could do.

Coincidentally, my AHK config was my first open source repo on GitHub. I'm glad to see it moving forward.

Post reply on HN