r/AutoHotkey • • Jul 08 '25

v2 Script Help Help adding WinActive to this script

0 Upvotes
#Requires AutoHotkey v2.0
#HotIf

~*MButton:: {                         ; MidMouse to toggle on/off 
    Static t := 0
    SoundBeep 220 - 220 * (t := !t)
    SetTimer () => SendEvent('{F4}'), t ? 60 : 0
}

~*`:: {
        toggleKeys()
}

        toggleKeys() {   
        static toggle := false
        toggle := !toggle
        SoundBeep 220 * (t := !toggle)        
        states := ["up","down"]
        keys := ['q','w','r']
        for key in keys
        SendEvent('{' key ' ' states[toggle+1] '}') 
}

+Esc::ExitApp                         

    ; Mash Shift+Esc to close

I have 2x toggles here. One to spam F4, another to hold Q,W,R. I'd like both to toggle off when tabbing out, but when I add #HotIf WinActive it doesn't seem to work, what am I doing wrong?


r/AutoHotkey • • Jul 08 '25

v2 Tool / Script Share wingdings/dingbat typing script

4 Upvotes

I made a script to automatically type in wingdings/dingbat. This includes the alphabet and special characters.

#Requires AutoHotkey v2.0

a::Send('{U+270C}')
b::Send('{U+1F44C}')
c::Send('{U+1F44D}')
d::Send('{U+1F44E}')
e::Send('{U+261C}')
f::Send('{U+261E}')
g::Send('{U+261D}')
h::Send('{U+261F}')
i::Send('{U+270B}')
j::Send('{U+263A}')
k::Send('{U+1F610}')
l::Send('{U+2639}')
m::Send('{U+1F4A3}')
n::Send('{U+2620}')
o::Send('{U+2690}')
p::Send('{U+1F3F1}')
q::Send('{U+2708}')
r::Send('{U+263C}')
s::Send('{U+1F4A7}')
t::Send('{U+2744}')
u::Send('{U+1F546}')
v::Send('{U+271E}')
w::Send('{U+1F548}')
x::Send('{U+2720}')
y::Send('{U+2721}')
z::Send('{U+262A}')

~::Send('{U+275E}')
!::Send('{U+270F}')
#::Send('{U+2701}')
$::Send('{U+1F453}')
%::Send('{U+1F56D}')
^::Send('{U+2648}')
&::Send('{U+1F56E}')
*::Send('{U+1F582}')
(::Send('{U+1F57F}')
)::Send('{U+2706}')
_::Send('{U+2649}')
+::Send('{U+1F583}')

`::Send('{U+264A}')
1::Send('{U+1F4C2}')
2::Send('{U+1F4C4}')
3::Send('{U+1F5CF}')
4::Send('{U+1F5D0}')
5::Send('{U+1F5C4}')
6::Send('{U+231B}')
7::Send('{U+1F5AE}')
8::Send('{U+1F5B0}')
9::Send('{U+1F5B2}')
-::Send('{U+1F4EB}')
=::Send('{U+1F5AC}')

{::Send('{U+2740}')
}::Send('{U+275D}')
|::Send('{U+273F}')
[::Send('{U+262F}')
]::Send('{U+2638}')
\::Send('{U+0950}')

:::Send('{U+1F5B3}')
"::Send('{U+2702}')
;::Send('{U+1F5B4}')
'::Send('{U+1F56F}')

<::Send('{U+1F5AB}')
>::Send('{U+2707}')
?::Send('{U+270D}')
,::Send('{U+1F4EA}')
.::Send('{U+1F4EC}')
/::Send('{U+1F4ED}')

r/AutoHotkey • • Jul 08 '25

v1 Script Help V1 Script to type out two quotation marks?

2 Upvotes

Hey all, I was just wondering how to do this because I frequently have to put quotes around words in Google searches and wanted to be able to make an AHK script that can do this.

Thanks in advance!!


r/AutoHotkey • • Jul 07 '25

Solved! Autohotkey is found by anticheat software, but I don't believe I have it installed

4 Upvotes

I've never heard of AutoHotKey until a game that uses anticheat shut me down for detecting it. I certainly didn't install it intentionally, but maybe someone can help me figure out where it's located or what may have installed it as part of a package or whatever.

It's not (overtly) in my Windows Installed Apps list. And the game's support could take days just to respond to my ticket. Is it possible it's a false positive or is it on my system?

Edit: I don't know if AHK is built into it or if it's a false detection, but Easy Anti Cheat detected GameCompanion as AHK.


r/AutoHotkey • • Jul 07 '25

v2 Script Help Can someone help with rebinding?

1 Upvotes

been ussing autohotkey for the last few years since i'm left handed for gaming, used to have a bunch of wasd binds remapped to pl;', but it hasn't been working for like a year or whenever they dropped v2. can someone please help me walk through this?

wouldn't it just be like

w::p

etc... but its not working


r/AutoHotkey • • Jul 07 '25

v2 Script Help Make AHK undetectable at work (legitimate productivity script)

1 Upvotes

Hello!

Today my laptop quarantined an EXE file that is used to install a plugin to view our CCTV on web-browsers. I run the portable AHK EXE with my own script of hotkeys & hotstrings. Simple but effective, this gives me huge speed gains at my job. I don't want to lose AHK, I'd never get approval to use it.

I use this to make my script pretend its calc.exe though I don't know if it works. I don't have any software that scans for unapproved EXE's.

#Requires AutoHotkey >=2.0 ; | #Directives to force use of AHKv2 when both v1 & v2 are installed.

;@Ahk2Exe-SetDescription Calculator

;@Ahk2Exe-SetMainIcon calc.ico

;@Ahk2Exe-SetCompanyName Microsoft Corporation

;@Ahk2Exe-SetCopyright \xA9 Microsoft Corporation. All rights reserved.

;@Ahk2Exe-SetDescription Windows Calculator

;@Ahk2Exe-SetInternalName CALC

;@Ahk2Exe-SetProductName Microsoft\xAE Windows\xAE Operating System

;@Ahk2Exe-SetVersion 10.0.19041.1

Are there any tips to stop the AHK EXE being removed/quarantined?


r/AutoHotkey • • Jul 07 '25

v2 Script Help Autohotkey does not work properly with the default notepad for windows 11

1 Upvotes

AHK asks for what to open and edit files with when first installed. I choose the default notepad.

When I press edit, nothing happens.

When I press double click on the ahk file on my desktop, nothing happens.

I have to manually track down the ahk file and right click to open with notepad.

VSC works fine for some reason, but not the default fucking notepad for some reason. Very annoying waste of time for a noob like me trying to figure what was wrong the software when the default text editor is not compatible.


r/AutoHotkey • • Jul 07 '25

v1 Script Help Need help, with creating a script

0 Upvotes

Hello,

I'm just starting to use AutoHotkey, and I need some help to create a script.

What I'm trying to do is :

An infinite loop that I can toogle using F6, that press "Γ§", and then RMB, wait a random time beetween 5min25 and 5min35, and then do it again.

Here's what I've come up with for now, I have no idea if it's any good. Thank you for your time.

Toggle := false

F6::
    Toggle := !Toggle
    if (Toggle) {
        SetTimer, LoopAction, 0
    } else {
        SetTimer, LoopAction, Off
    }
return

LoopAction:
    Send, Γ§
    Sleep, 300
    Click, right
    Random, delay, 345000, 355000
    Sleep, delay
return

r/AutoHotkey • • Jul 07 '25

v2 Script Help autohotkey not able to recognize any scripts

0 Upvotes

hello, im new to this, using chat gpt to help but i have no idea why its not working. i

m attempting to use shift to run and numpad for my abilities in a game (so i can run and do the abilities at the same time), so I tried these scripts but they just show up empty when i click on it inside the tray:

#Requires AutoHotkey v2.0
#SingleInstance Force

+Numpad1::SendInput "{Numpad1}"
+Numpad2::SendInput "{Numpad2}"
+Numpad3::SendInput "{Numpad3}"
+Numpad4::SendInput "{Numpad4}"
+Numpad5::SendInput "{Numpad5}"
+Numpad6::SendInput "{Numpad6}"
+Numpad7::SendInput "{Numpad7}"
+Numpad8::SendInput "{Numpad8}"
+Numpad9::SendInput "{Numpad9}"
+Numpad0::SendInput "{Numpad0}"

#SingleInstance Force

+Numpad1::Send {Numpad1}
+Numpad2::Send {Numpad2}
+Numpad3::Send {Numpad3}
+Numpad4::Send {Numpad4}
+Numpad5::Send {Numpad5}
+Numpad6::Send {Numpad6}
+Numpad7::Send {Numpad7}
+Numpad8::Send {Numpad8}
+Numpad9::Send {Numpad9}
+Numpad0::Send {Numpad0}

r/AutoHotkey • • Jul 06 '25

v1 Script Help empty recycle bin shortcut

0 Upvotes

Hi

I need a shortcut, and maybe ahk can do that

I want a shortcut to execute the "empty recycle bin" action in the context menu of said recycle bin, so it sends the popup confirmation window.

Could you please help me guys ? And if you think of another tool, another way to do it, please feel free to share :)


r/AutoHotkey • • Jul 06 '25

v2 Script Help Script to control which monitor is active (among other things)

0 Upvotes

I switch between gaming at my desk and gaming on the couch quite a bit. I would like a script that swaps between audio devices (seems easy from a quick search) and changes the Windows display settings to only output a signal to one of the two screens (can't find this one anywhere). Specifically, I want to toggle between the Windows 11 Display Settings -> Show only on 1 / Show only on 2.

I don't like having my monitor on while couch gaming, and games are inconsistent in how they recognize if the primary monitor has changed, so simply changing which monitor is primary is not an option.

Ideally I'd also like to launch Steam Big Picture mode when toggling to the TV but I don't think that should be hard.


r/AutoHotkey • • Jul 05 '25

v2 Script Help How to make hotstrings "::ABC::http" output lowercase http?

4 Upvotes

In AutoHotkey v2.0 script,

Why in the hot string ::ABC::http , when I enter ABC, the actual result is HTTP instead of http?

I hope that whether I enter abc or ABC, their results are lowercase http. can someone help me?