Skip to content

Instantly share code, notes, and snippets.

@BGMcoder
Created June 5, 2015 18:32
Show Gist options
  • Select an option

  • Save BGMcoder/8f8c62ac21eb9d416ed5 to your computer and use it in GitHub Desktop.

Select an option

Save BGMcoder/8f8c62ac21eb9d416ed5 to your computer and use it in GitHub Desktop.
ahk info
;push win+3 to show your autohotkey information and copy it to your clipboard so you can paste it
#3::ahkinfo()
ahkinfo(){
isunicode := a_isunicode ? "Unicode" : "ANSI"
thisinfo:= "AutoHotkey " . a_ahkversion . " " . isunicode . " on Windows 7 Pro x64"
clipboard := thisinfo
alert(thisinfo)
}
@Tcip
Copy link

Tcip commented Aug 7, 2025

Cool! But inside the ahkinfo() function. You are calling to alert(thisinfo) which does not exist.

Here is a slightly more modern version that asks if you want to copy the information to the clipboard.

#3::AutoHotKey_Info()

AutoHotKey_Info() {
  IsUnicode := A_IsUnicode ? "Unicode" : "ANSI"
  bitOS := A_Is64bitOS ? "64-bit" : "32-bit"
  ThisInfo := "AutoHotKey " . A_Ahkversion . " " . IsUnicode . " on Windows " . A_OSVersion . " (" . bitOS . ")"
  MsgBox, 4,, % ThisInfo "`nCopy to clipboard?"
    IfMsgBox, No
    ExitApp
  clipboard := ""
  clipboard := ThisInfo
  ClipWait
  MsgBox, Copied the following contents to the clipboard:`n`n%clipboard%
    IfMsgBox, Ok
    ExitApp
}

Output example

AutoHotKey 1.1.37.00 Unicode on Windows 10.0.19045 (64-bit)

@BGMcoder
Copy link
Author

BGMcoder commented Aug 7, 2025

The alert() function is from a library I use. It was just a wrapper for msgbox because it was easier to type and I liked it from javascript. Good catch though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment