Questions tagged [autohotkey]

AutoHotkey (AHK) is a free, open-source macro-creation and automation software for Microsoft Windows that allows users to automate repetitive tasks. It is driven by a scripting language that was initially aimed at providing keyboard shortcuts, otherwise known as hotkeys, that over time evolved into a full-fledged scripting language.

AutoHotkey (AHK) is a free, open-source macro-creation and automation software for Microsoft Windows that allows users to automate repetitive tasks. It is driven by a scripting language that was initially aimed at providing keyboard shortcuts, otherwise known as hotkeys, that over time evolved into a full-fledged scripting language.

AutoHotkey can be used to:

  1. Automate almost anything by sending keystrokes and mouse clicks. You can write a mouse or keyboard macro by hand or a macro recorder.
  2. Remap keys and buttons on your keyboard, joystick, and mouse.
  3. Create hotkeys for keyboard, joystick, and mouse. Essentially any key, button or combination can become a hotkey.
  4. Automate almost any kind of GUI.
  5. Retrieve and change the clipboard's contents.
  6. Opening programs, documents, and websites with simple keystrokes.
  7. Monitoring a system and automatically opening wanted and closing unwanted programs.
  8. Scheduling an automatic reminder, system scan, or backup.
  9. Creating text replacement task or automatic spelling corrections.
  10. Convert any AHK script into an executable file that can be run on computers where AutoHotkey is not installed.
  11. Create simple GUI tools.

AutoHotkey also has a very friendly and helpful community.

Resources

4574 questions
6
votes
1 answer

Newest Spotify update: Autohotkeys script broke

I used to use the AutoHotKey script for Spotify shortcuts (the built in shortcuts are limited and only work if the app is in focus, I usually keep it in the background at work). Anyway, it's updated a million times before with no problem.. but I…
swinkel
  • 220
  • 2
  • 15
6
votes
2 answers

How do I delay send commands in AutoHotKey?

How do I delay Send commands in AutoHotkey? If AutoHotkey sends the keypresses faster than a program can register the inputs, words can end up mistyped with missing letters. (stuff ends up like stf, or wasd squad ends up like wsdsqad)
zulc22
  • 337
  • 2
  • 7
  • 17
6
votes
3 answers

How can I make AutoHotKey intercept hotkeys before other programs?

I have a fairly simple autohotkey script that starts and stops music playback when I press one of the XButtons on my mouse: XButton1::Send {Media_Play_Pause}. The program works just perfectly and I have no problems with it. However, when I'm using…
vividn
  • 121
  • 5
6
votes
2 answers

How to have your delimiter double and single, too

In my custom Notepad++ user-defined language (UDL) for AutoHotkey, I am trying to fix an issue where the colours for variables don't display correctly. In the UDL configurator, I have, under Operators & Delimiters, specified Delimiter 1 Style…
bgmCoder
  • 6,205
  • 8
  • 58
  • 105
6
votes
1 answer

How do I automate a Java application with AutoHotkey?

I am using a Java application at work. I need to send clicks to buttons and fill in textboxes. I would like these actions to happen in the background. The ahk_class of the window is SunAwtFrame, and none of the controls are exposed to WindowSpy. I…
Brett Banks
  • 170
  • 2
  • 8
6
votes
2 answers

How can I make an AutoHotkey message box dissapear without clicking okay?

I need something like a msgbox displaying in my script but without the need for waiting to click okay. What I need is to display a string for a certain duration of time and then make it disappear. It would be helpful if it can display a live timer…
MelBurslan
  • 2,383
  • 4
  • 18
  • 26
6
votes
4 answers

Call Autohotkey script from C#

I am complete beginner with C#, but advanced user with autohotkey. If I have this script, how could I call that from C#? ins::suspend SendMode Input Lbutton:: Loop { GetKeyState, state, Lbutton, P if state=U break …
Valters Tomsons
  • 109
  • 1
  • 1
  • 8
6
votes
2 answers

Why doesn't AutoHotkey support default parameters in the middle of the parameter list?

In AutoHotkey, you can leave out arguments in the middle of a built-in function call as so: MsgBox, 4,, Blah MouseGetPos,,, MouseWin You can also create functions with optional parameters à la C++: Foobar(baz, blah="something") { MsgBox…
Synetech
  • 9,643
  • 9
  • 64
  • 96
5
votes
0 answers

How to concatenate string and variable in autohotkey v2?

Here's a piece of code that works in v1: Var1 := "Example" %Var1%Variable := "Concatenated Variable" MsgBox % ExampleVariable This syntax however seems to be removed from v2. Is there any way I can do this in v2?
CrenshawDK
  • 317
  • 1
  • 10
5
votes
1 answer

Windows 11 Cascade Windows: possible with e.g. AutoHotkey, not with VBScript or PowerShell

In Windows 10, I was able to use "Cascade Windows" with a simple .vbs script: set objShell = CreateObject("shell.application") call objShell.CascadeWindows() The same is possible with PowerShell: $ShellExp = New-Object -ComObject…
Stijn Bousard
  • 331
  • 2
  • 8
5
votes
1 answer

ctrl+s not being sent in autohotkey script

i.e. hitting ctrl+s should activate ctrl+s...the below does not work. Neither does the simpler SendInput, ^s. Goal is to have ctrl+s save current doc and then load another via more code, the saving part never works tho. The bad code, depending on…
kite
  • 309
  • 2
  • 12
5
votes
1 answer

When to use % or %variable% in AutoHotKey?

I have searched around quite a bit and have failed to find an answer. In AutoHotKey, I am not sure the difference when a single percent is used near the beginning of a line, and when a variable is enclosed between two percent signs. I usually use…
wetin
  • 360
  • 1
  • 3
  • 13
5
votes
2 answers

Determine which monitor the focus window is on?

Small AHK function to determine which monitor the focus window is on. I was writing a script that needed context on which monitor the focus window was on. I found quite a few solutions, but none were too easy to follow, or were a little more…
Anu
  • 318
  • 1
  • 11
5
votes
1 answer

Open, Rename, and Minimize Google Chrome Instance

So basically I am trying to open a new incognito Chrome, and set the title of the tab so I can Winactivate it later and minimize the window. I think it is mostly a problem with my variable 'myIncog' setting and usage. This script should open a new…
Slid3r
  • 323
  • 1
  • 3
  • 11
5
votes
2 answers

Remap only Windows key, keeping windows key combinations

I wish to remap only Left Windows key when pressed alone and keep every Left Windows key combination such as LWin+Left/Right etc So far no solution I've tried worked very good: Sometimes the script does not intercept windows key and mostly doing…
krizajb
  • 1,715
  • 3
  • 30
  • 43