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
9
votes
5 answers

Hotkey to restart autohotkey script?

Say I have an autohotkey script C:\path\to\my\script running. Is there a way to define a hotkey that re-starts it?
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
9
votes
6 answers

How do I use 'or's in AutoHotKey scripts?

I have been browsing the AutoHotKey documentation, and I don't see a clear use of how to use 'or' in context specific hot keys. On my setup, Cygwin will either launch with ahk_class cygwin (when I use the context menu) or mintty (when I use the .bat…
Ehryk
  • 1,930
  • 2
  • 27
  • 47
8
votes
1 answer

Hotkey if statement using multiple conditionals

The following script works to open Firefox's location/"awesome" bar from anywhere using control-l, except when using Acrobat/Adobe reader. This is because control-l in Acrobat goes full screen. It works, but it's ugly and uses nested…
Jeff Axelrod
  • 27,676
  • 31
  • 147
  • 246
8
votes
2 answers

AutoHotkey: Disable Ctrl+Shift (Windows 10 - keyboard layout switch)

How can I disable the Ctrl+Shift hotkey (keyboard layout switching) in Windows 10 using AutoHotkey? (However I would like to keep all combinations of this: Ctrl+Shift+Any other key) I've tried this, but it's not blocking the hotkey: ; Test.ahk ;…
user
  • 6,567
  • 18
  • 58
  • 85
8
votes
4 answers

How to trigger the Windows volume display?

When the standard keyboard key to increase the volume is hit on windows, a small window appears in the upper left displaying the volume and possibly information about playing media. I am looking for a way to trigger the window without changing the…
8
votes
1 answer

How to check if string is contained in an array in AutoHotKey

I have following code: ignored := [ "Rainmeter.exe", "Nimi Places.exe", "mumble.exe" ] a := ignored.HasKey("mumble.exe") MsgBox,,, %a% It returns 0 even though the string is clearly present in the array. How do I test if a string value is present…
monnef
  • 3,903
  • 5
  • 30
  • 50
8
votes
3 answers

Low-level Keyboard Hooks/SendInput with Winkey+L possible? (workstation lockout is intercepted in Vista and higher)

I work on a project called UAWKS (Unofficial Apple Wireless Keyboard Support) that helps Windows users use Apple's bluetooth keyboard. One of the main goals of UAWKS is to swap the Cmd key (which behaves as Winkey in Windows) with Ctrl, allowing…
Brian Jorgensen
  • 1,230
  • 14
  • 17
8
votes
3 answers

Quickly send long text in AutoHotkey

I've been trying to figure out how to insert/expand long text faster. The current keystroke method I'm using is quite time consuming and therefore something I would rather avoid. Right now I am using the following method: ::abc::all bad cats Or for…
Shezan Kazi
  • 4,471
  • 3
  • 14
  • 27
8
votes
1 answer

Are backticks possible in AHK hotstring?

I need to have a hotstring with backticks in it (`) surrounding it. Simplifying what I've tried: ::`hw`::Hello, World! Running it gives an error: "Invalid hotkey". I'm not sure why this restriction exists but more to the point: is there any…
MasterMastic
  • 20,711
  • 12
  • 68
  • 90
8
votes
2 answers

Is there an AutoHotkey REPL?

I know that you can run and live-reload ahk scripts. And I've seen the scintilla-based editor that provides debugging. But, is there any kind of command-line-based REPL? I was testing the statement to get the active window's process name and thought…
Anthony Mastrean
  • 21,850
  • 21
  • 110
  • 188
8
votes
2 answers

How to star a Spotify song with Autohotkey while it's minimized?

How to star a Spotify song while it's minimized? Okay so the Spotify application on Windows does not have inbuilt support for global hotkeys, and very basic hotkeys even when the application window is currently active. Frustratingly 'starring' the…
bluesatin
  • 93
  • 2
  • 6
8
votes
1 answer

Autohotkey application-specific hotkeys

I am a newbie to Autohotkey, and I can't figure this out despite reading through this site and the official documentation. I just want to have certain hotkeys work only with certain applications. So for example, if I press spacebar in a certain game…
user1843366
  • 83
  • 1
  • 4
8
votes
1 answer

How do I insert formatted text using AutoHotkey?

I created a script that inserts today's date in any Windows application. I would like to control the format such as font and/or color when I paste it into the target application. I can't seem to find it in the documentation or in any of the help…
Joe
  • 81
  • 1
  • 2
8
votes
5 answers

Dynamically Create AutoHotkey Hotkey to Function/Subroutine

The AutoHotkey command Hotkey allows for the creation of dynamic hotkeys at runtime, but its syntax and documentation seems to limit it to built-in or existing labels/subroutines, which makes it much less useful: Hotkey, KeyName [, Label,…
Synetech
  • 9,643
  • 9
  • 64
  • 96
8
votes
1 answer

AutoHotKey: Instant text replace

One part of my AutoHotKey script replaces @@ with my email address. Currently, I'm doing this like so: ::@@:: SendInput, example@domain.com return Simple enough and it works fairly well but you need to push space / comma / period / etc before it is…
mythofechelon
  • 3,692
  • 11
  • 37
  • 48