Skip to content

a list of sketchy things you can do in AutoHotkey_L v1.1

Notifications You must be signed in to change notification settings

Andreas-Coding/autohotkey-oofs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

A list of borderline sketchy things you can do in AutoHotkey

Call multiple functions without spaces.

f1() {
    msgbox % A_ThisFunc
}
f2() {
    msgbox % A_ThisFunc
}

f1()f2()

Writing code inside continuation sections.

msgb
( LTrim Join
o
x % A
_UserN
ame
)

Using multiple continuation sections for one string

MsgBox,
(
Hello
) World
(
!
)

Using expression continuation in plain text mode

MsgBox, When writing in plain text
, you can continue your line onto the next
. Just make sure to punctuate at the start
! For some reason commas, when used in this manner
, don't cause leading whitespace
, but all other punctuation does
. Isn't that great
? This feature was designed for use with expressions
, but it works fine without them too!

Converting a pure JSON string to an ahk object.

Okay, this one is actually kind of cool. Obviously doesn't handle JSON types like null.

obj :=
( LTrim Join
{
    "key": "value",
    "list": [
        "item1",
        "item2"
    ]
}
)

for k, v in obj {
    msgbox % k " " v
}

Single-equals sometimes does expression assignment

In some situations, the dual purpose single-equals operator (normally plain-text assignment or case-insensitive equality) can take on a third purpose: expression assignment.

MsgBox, % "Test: "
. (a = 1      ; Comparison
,  b = 2      ; Expression assignment
,  c = b + 1) ; Expression assignment
. "," a "," b "," c

AutoHotkey can click its own Hotkeys

Just why?

#MaxHotkeysPerInterval, 9140
#MaxThreadsPerHotkey 255
#MaxThreads 255
SetBatchLines, -1
SetKeyDelay -1, -1
SendInput, a
~a::SendInput bb
~b::SendInput cc
~c::SendInput dd
~d::SendInput ee
~e::SendInput aa

About

a list of sketchy things you can do in AutoHotkey_L v1.1

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published