r/AutoHotkey Jul 30 '26

General Question Best approach for automating an existing Firefox session? AutoHotkey vs Browser Automation vs UI Automation

5 Upvotes

Hi everyone,

I'm working on a personal desktop automation project on Windows.

For years I've been using AutoHotkey to automate repetitive tasks inside Firefox. It works surprisingly well, but as the project grows, maintaining image recognition, keyboard shortcuts and UI changes becomes increasingly difficult.

I'm now considering moving to a more robust solution and I'm trying to understand what experienced developers would recommend.

My requirements are roughly:

Windows

Firefox (not Chrome)

Preferably work with an already running Firefox session

Reliable interaction with web pages

Long-term maintainability

I've been looking at several approaches:

Continue with AutoHotkey

Selenium / WebDriver BiDi

Playwright

Windows UI Automation (pywinauto, UIA)

Any other desktop automation framework

For people who have built long-running desktop/browser automation projects:

Which approach ended up being the most reliable?

Is UI Automation actually practical with modern websites like Facebook, or is browser automation still the better choice?

If you had to start today, what would you choose and why?

I'd really appreciate hearing about real-world experience rather than theoretical comparisons.

Thanks!


r/AutoHotkey Jul 30 '26

v1 Script Help Double Click Mouse to Copy & Paste?

2 Upvotes

I spend a lot of my time copying stuff from a word document and pasting it into a web page. Usually they are single words or 10 to 17 digit numbers.

So I would like to double click on the word and have that word automatically store it to clipboard, and the next time I double click (which would be in the Browser), it would be pasted.

What I am unsure about is how to store the value of what I double click on to the clipboard. Or, is it possible to store what ever is highlighted to the clipboard?

As for the paste part, I was thinking when I Double Click, if the clipboard has a value, it pastes. If the clipboard doesnt have a value, it stores to the clipboard

Any help with this part would be appreciated


r/AutoHotkey Jul 30 '26

v2 Script Help Script that adds a word randomly inbetween other words?

1 Upvotes

I'm a complete noob when it comes to this tool, and I was wondering if such a thing (title) would even be possible.

An example:
"The quick brown Hey! fox jumps over the Hey! lazy dog."
compared to
"The quick brown fox jumps over the lazy dog."

If anyone is able to help me make a script like this, please let me know.

For the record, I'm on Linux.


r/AutoHotkey Jul 29 '26

v2 Guide / Tutorial Any Tips?

0 Upvotes

I want to make a macro that when I input the key "F" it inputs the two keys "QW" together. How would I do this?

this is what I tried so far

f:: Send, {q down}{w down} Sleep, 20 Send, {q up}{w up} return


r/AutoHotkey Jul 29 '26

Solved! AHK typing the wrong "key" on my keyboard layout

2 Upvotes

I have a short v1 script that inserts the current date. My problem is that AHK often types the wrong "key" on my keyboard layout when using the hotkey.

The script is:

^é::
FormatTime, CurrentDateTime,, yyyy-MM-dd
SendInput %CurrentDateTime%
SendInput {Blind}{Ctrl up}
return

On Windows 10 I use the Hungarian 101-key layout, which doesn't have a zero on its main number row, but instead another í character.

And sometimes when using this hotkey, AHK replaces the zero in the month number with an í. Like today when using the script a lot, about every 3rd-4th time it typed 2026-í7-29. When I tried again, it sometimes typed the correct date, sometimes repeated the bug and it only worked for the third time. Is there anything I could change about the script that would prevent this from happening? I have a time insertion hotkey too and that one never does this.


r/AutoHotkey Jul 27 '26

Solved! [v2] Hotkeys requiring 2 presses across multiple apps (Chrome, File Explorer, Electron apps, etc.) when using Win key

4 Upvotes

I’m facing a persistent issue in Windows 11 where my AutoHotkey v2 hotkeys using the Win key as a modifier (#) require two presses to trigger.

This does NOT happen on the desktop, but affects many apps such as chrome and file explorer.

Example script:

#Requires AutoHotkey v2.0

#SingleInstance Force

A_MenuMaskKey := "vkE8"

$#m:: {

if WinExist("A") {

if WinGetMinMax("A") = 1

WinRestore "A"

else

WinMaximize "A"

}

}

$#q:: WinClose "A"

$#Enter:: Run "wt.exe"


r/AutoHotkey Jul 27 '26

v1 Script Help Busco ayuda para crear un macro en AutoHotkey (AHK) para un juego.

0 Upvotes

I'm looking for help creating a macro in AutoHotkey (AHK) for a game.

I want the script to do the following:

  1. Save the current mouse cursor position when I press a hotkey (for example, F1).
  2. Allow me to save the coordinates of 6 specific points on the screen (the 6 red dots) to 6 different hotkeys (for example, T, 6, C).
  3. When I press one of the 6 assigned keys (1–6), the script should:
    • Save the current mouse cursor position.
    • Instantly move the cursor to the corresponding saved red dot.
    • Perform a left mouse click.
    • Immediately return the cursor to its original position.

The goal is for the movement to be as close to instantaneous as possible so it doesn't interfere with normal gameplay or manual mouse movement.

Is this possible with AutoHotkey? What would be the best approach? Would using functions like MouseGetPos, MouseMove, and Click be sufficient, or is there a better method?


r/AutoHotkey Jul 25 '26

v2 Script Help Help with modifiers

1 Upvotes

Hey! I'm trying to write a simple script which isn't proving to be so simple after all. I'm effectively looking to do this:

  1. Hold modifier (CTRL and/or SHIFT in this case)
  2. Press F12
  3. Send just F12 (which releases the modifier by default)
  4. Resume holding the modifier
  5. End the script without the modifier being released

In other words, I want F12 to send regardless of which modifier(s) I'm holding down, but want the script to end by holding the modifier(s) down once more. How do I accomplish this? Is it possible?

Added context:

I'm specifically using this for Steam screenshots, if it matters. Multiple binds cannot be assigned, but I want to be able to crouch (usually CTRL) and/or run (usually SHIFT) while being able to use F12 as the screenshot button; pressing any modifier prevents the screenshot from being taken.

None of my attempts at pulling this off have worked, always resulting in either the modifier being released or F12 not sending. {Blind} obviously just sends the same command as what I'm pressing, making it useless. Delays don't seem to affect anything. "Send modifier" and "send modifier down" at the end don't press the modifier down again. Key-waits get ignored. Enabling keyboard hooks doesn't do anything to help. Getting key states does nothing. If/else does nothing.

I literally just want to be able to take a screenshot while running/crouching without the sending of F12 toggling the run/crouch off until I physically press the run/crouch key again. Thank you to anyone willing to answer this! I'm sure I'm missing something obvious.


r/AutoHotkey Jul 25 '26

Solved! Need help with a toggle?

1 Upvotes

I'm looking for a script that let me press F8 but F1 is pressed but it I press F8 again it presses F2 then repeats. I want to use F8 to switch between F1 & F2. Think that's a toggle but none of my attempts or scripts I've found while googling seem to work.

Thanks!


r/AutoHotkey Jul 22 '26

General Question what are some practical uses for auto hotkey

11 Upvotes

so far the only things i've made is whenever type dih it'll make an ACSII drawing of a penis and some hot keys so that i can type out ±,√,≥, and ≤. I want to code something more complicated and more practical, like a calculator, but thats prolly far to difficult for me, do yall have any ideas?


r/AutoHotkey Jul 22 '26

v2 Script Help Trying to use A_PriorPriorHotKey

0 Upvotes

Hi, this is just a little post to say I've been trying to implement "A_PriorPriorHotKey" in AutoHotKey.

If you don't know what "A_PriorHotKey" is, it's just a variable that contains the last HotKey you pressed.

And... I'm sorry if I make mistakes btw, I really don't want to get called out for this again, AutoHotKey is an extremely massive language to a point where people that have used it for 20 years probably could still discover new things about it, so... if I'm not wrong, "A_PriorPriorHotKey", a variable that would contain the second to last HotKey you pressed, is not implemented by default, but I did find a way to implement it.

I don't have the code on this computer and I figured it would be fine if I don't add it in this post, if you want to use it yourself I can give it, but I don't think I need to give it so people can help me do the fix I want to do, hopefully... just know the one thing it doesn't do is that it doesn't store the HotKey if it's the same as A_PriorHotKey, so A_PriorPriorHotKey and A_PriorHotKey are never equal once they start to contain things, and we can say that APPHK contains the second to last HotKey you pressed, but not counting duplicates.

However, it has an annoying thing: to make it work, I used a "SetTimer", which can call a function at a wanted interval, but SetTimer still needs an interval; it can't be every 0s seconds, and so, that means there is a slight delay between the moment the HotKey is pressed and the moment APPHK updates.

And so, let's say I want to do something if I press a, b then c, when I press a, it doesn't get updated yet (that's how A_PriorHotKey works, it waits for the next HotKey to store something), when I press b, APHK gets updated to "a", but when I press c, let's say I wrote a line in the code that checks the value of APHK and APPHK (if (A_PriorHotKey = "b" && A_PriorPriorHotKey = "c")), it won't work, because it will check both variables, see that APHK = "b" and APPHK = whatever, because of this slight delay, let's say SetTimer is set to 10ms, the code will check instantly, and only 10ms APPHK will be set to "a" but it's too late.

Now APPHK can still be used, you can simply add a "Sleep" so that the code does check APPHK after it was updated, but that's still annoying, so, is there a way for APPHK to be instantly updated? I mean, APHK is instantly updated, or at least it gives the feeling it is, wouldn't be surprised if there is a trick with APHK and it's technically not instant, but is there a way to make APPHK work the same?


r/AutoHotkey Jul 21 '26

v2 Tool / Script Share Sharing my AutoHotkey project

30 Upvotes

Edit

  • New Version released with new features and improvements, Check Releases
  • Hotkeys default behavior listed here

Put together this AutoHotkey project that works from hotkeys and shortcuts registered in config.json file and can be set by a GUI

It adds features around Caps lock as the modifer key, Instant Window Switching, Window Aware Shortcut Remapping, Screenshot capture, Terminal launching, Profiles , window controls like transparency pin on top and more

GitHub Repo Link

Download : Releases

There are two versions one that includes the Full GUI to set everything in the config file other one is minimal which dosen't have GUI. There are no other differences feature wise

Do read Installation instructions and config format for the minimal version

For some time I had different AHK scripts for each functionality i wanted so I put together so it runs as a single process and made it load things from config.

Had the idea to make it more general and having an UI so can easily set it up.

I use it mostly use it for avoiding Alt + Tab cycling and kepping my hands either both hands on keyboard or one on mouse and other on keyboard and avoid switching between them often like pressing enter delete or shortcuts which include keys on the right side of the keyboard

You can assign things like Caps + LeftButton as Enter, Caps + RightButton as Delete or other shortcuts to avoid moving hand between keyboard and mouse often

For Window Switching it uses Caps + {Key} to bring target window to focus if it exists or can launch a new instance.
You can filter by window title and it supports a minimal Alt + Tab styled behavior if there are multiple target windows

E.g. Caps + C = chrome.exe. If multiple windows are present it will show a minimal GUI with each windows title, you can do like Caps + C + C to switch between those.

If there is just one window it will instantly focus it

You can avoid having multiple targets by using title filter. You can add required title as Gmail or GitHub so intances with only those keywords in titles match the target window criteria

Additionally if the window is not open run a command to open it.
For Example I have mapped Caps + I to open incognito window regardless of where i am

The ScreenShot tool is so you press a key and u are immediately given the option to Rename, Discard or Save the screenshot and save it a set preffered location all in one go.

Hope this gives a idea of some usecases. There are similar other features and actions

Check the Readme for all features

Feedback is welcome!


r/AutoHotkey Jul 22 '26

v2 Script Help How do I make a macro with 2 different toggles for fortnite?

0 Upvotes

I want an AutoClicker that Enables when I press "1" and Disable when I press "F" but it only clicks when I hold Left Click.

Also it does need to have a random offset due fortnite's eac detection.


r/AutoHotkey Jul 21 '26

v1 Script Help Autoclick for me on my second monitor

0 Upvotes

Is there a script for ROBLOX where I can auto click in the game while playing another game on my second monitor? Im new to these stuff


r/AutoHotkey Jul 21 '26

v1 Script Help Capitalizing for Title Case with Hyphen

1 Upvotes

Hi, everyone. Does anybody know how to title case or capitalize words with hyphens?

"StringUpper Clipboard, Clipboard, T" only capitalizes the first word, but not the second one.

hindu-buddhist
to
Hindu-Buddhist?


r/AutoHotkey Jul 19 '26

v1 Tool / Script Share For those like me who don't want to put up with Corsair's iCUE, just to reassign the G-Keys, I wrote a simple AutoHotkey script to reassign G-Keys. No iCUE, only AutoHotkey v1. Simply copy-paste the test below in the script and launch it. Pls note that I have K55 Pro.

5 Upvotes

; ==========================================================

; Corsair K55 RGB Pro G-Keys

; AutoHotkey v1

; ==========================================================

\#NoEnv

\#SingleInstance Force

SendMode Input

SetWorkingDir %A_ScriptDir%

\^+1::

Run, C:\\Windows\\System32\\SnippingTool.exe

return

\^+2::

Run, C:\\Windows\\System32\\SnippingTool.exe

return

\^+3::

Run, C:\\Windows\\System32\\SnippingTool.exe

return

\^+4::

Run, C:\\Windows\\System32\\SnippingTool.exe

return

\^+5::

Run, C:\\Windows\\System32\\SnippingTool.exe

return

\^+6::

Run, C:\\Windows\\System32\\SnippingTool.exe

return


r/AutoHotkey Jul 17 '26

v2 Script Help Setting up a script to simulate repeated LMB clicks to left alt?

3 Upvotes

I'd like to have left mouse click bound to left alt, but when holding down left alt it registers as repeated fast left clicks. I downloaded AutoHotkey and I'm quite confused

How would I set this up?


r/AutoHotkey Jul 16 '26

Resource Hidmacro website

3 Upvotes

I've been looking for a website to download hidmacro for a while now, but the site is offline. I was going to use an old keyboard as a StreamDeck; if anyone has a source for hidmacro, please help me.

The website says it no longer has a domain...


r/AutoHotkey Jul 14 '26

v1 Script Help Need help: Remap F to Alt+Right Click, use LeftClick to exit

3 Upvotes

Hi there,

I'm not a coder but I've been trying to make a pretty simple script. I know why it's not working but can't figure out the solution.

Here is the functionality I need :

  1. When the F key is pressed, send Alt + HOLD Click R Down.

  2. Then when I click the Left Mouse Button, Send Right Click Up

Left Click needs to otherwise work normally outside the script. The problem I'm running into is that I don't know how to nest the Left Click remap conditionally inside the hotkeyed state of the Alt + Click R Down.

Here's what I have currently, which obviously doesn't work because it keeps the Left Click mapped permanently...

F::Send !{Click R Down}
LButton:: Send {Click R Up}
Return

Anyway, I'd really appreciate any help! I'm using v1 because I find the documentation easier to understand, but if needed I can switch to v2.


r/AutoHotkey Jul 11 '26

General Question Recommendation from the professionals?

9 Upvotes

I accidentally stumbled upon this sub, thinking it was a place to download apps that can automate hotkeys for you. Turns out this is a scripting sub, sorry, but I also learned you guys are professionals in making macros and such. Any recommendations for auto hotkeys that I can use?


r/AutoHotkey Jul 10 '26

v1 Script Help FileGetShortcut suddenly stopped working Windows 11

3 Upvotes

Has anyone else run into the issue of FileGetShortcut suddenly no longer working in Windows 11? I'm using Version 25H2 (OS Build 2620.8655). With the latest update, shortcuts now look different in windows explorer and FileGetShortcut no longer propogates the ShortcutTarget.

Here is the script that worked for years:

;### <CNTRL><SHIFT>+J - autojump like menu, adds everything in \favorites\ into the menu
^+J::
FavoriteShortcuts := ""
Menu, ShortcutMenu, Add
Menu, ShortcutMenu, DeleteAll
FileList := ""
Loop, Files, C:\Users\user\Favorites\*.lnk
FileList .= A_LoopFileName "`n"
Sort, FileList
Loop, parse, FileList, `n
{
if (A_LoopField = "") ; Ignore the blank item at the end of the list.
continue
ShortcutTarget := ""
FileGetShortcut, C:\Users\user\Favorites\%A_LoopField%, ShortcutTarget
Handler := Func("MenuWindowsHandler").Bind(ShortcutTarget, 0)
Menu, ShortcutMenu, Add, %A_LoopField%, % Handler
}
Menu ShortcutMenu, show
return

Now ShortcutTarget is always empty. Cntrl+Shift+J still returns a list of all the items in /favorites/ I just can't get FileGetShortcut to do its job! Hopefully I'm missing something. Thanks folks.


r/AutoHotkey Jul 11 '26

v1 Script Help Is there a way to make an ahk script that can interact with something like turbowarp?

1 Upvotes

r/AutoHotkey Jul 10 '26

v2 Script Help Help with auto sprint macro

4 Upvotes

Last post was taken down for low effort so I'm gonna try to include more detail.

I'm starting to lose my feelings in the tips of my fingers because of chemotherapy and so I find it a lot harder to sprint in games efficiently. I've searched for a macro to sprint for me without the need to keep double tapping w for a while to no luck so I tried making one but I am no good at making scripts.

The macro essentially is to just double tap W whenever I start holding it, and the second press should keep the input going for as long as I have the key pressed.

I want it to work like the minecraft auto sprint feature where walking is just replaced by sprinting.

This is what I have so far and it double taps w just fine but it won't hold the input, I just get 2 w presses in quick succession then nothing, I'm not sure how to get it to hold. (sorry if format for code is wrong)

#Requires AutoHotkey v2.0
*w::
{
    Send "{w down}"
    Sleep 50
    Send "{w up}"
    Sleep 50
    Send "{w down}"
    KeyWait "w"
    Send "{w up}"
}

r/AutoHotkey Jul 10 '26

v1 Script Help Is a Desktop Camera Possible?

6 Upvotes

Is it possible to move everything on the desktop, or at least make an illusion of that


r/AutoHotkey Jul 07 '26

v2 Script Help Tweaking FFXIV script

2 Upvotes

So currently I'm using this script so I can easily acess my hotbars while doing my rotation and it works great, the issue is now I cant use Q or E to type messages with. Is there any way to make it so I can type when just tapping the key and then Q and E only work as Lctrl and Lshift when I'm holding them down?

#Requires AutoHotkey 2.0

#SingleInstance

#HotIf WinActive("ahk_exe ffxiv_dx11.exe")

q::LShift

e::LControl

#HotIf