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
23
votes
2 answers

What happens 'behind' the windows lock screen?

I have been working on windows automation and monitoring. What exactly happens when I lock the screen of a windows machine? I am working with Windows 7 at the moment, are there big differences to the behavior if I switch to Vista or the server…
Plastefuchs
  • 437
  • 1
  • 4
  • 10
22
votes
3 answers

How can I maximize a window across multiple monitors?

Using AutoHotkey, How can I bind a hotkey to stretch/maximize/span a window across multiple monitors so that it covers both displays? Right now, I have to do this by manually stretching the windows with the mouse. I know there are dedicated tools…
Jeff Axelrod
  • 27,676
  • 31
  • 147
  • 246
22
votes
2 answers

What is ahk_class? How can I use it for window matching?

The AutoHotkey Beginner Tutorial includes a sample script to demonstrate window specific hotkeys and hotstrings. #IfWinActive ahk_class Notepad ::msg::You typed msg in Notepad #IfWinActive #IfWinActive untitled - Paint ::msg::You typed msg in…
Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
22
votes
5 answers

AutoHotkey in Windows 10 - Hotkeys not working in some applications

A simple script like a::msgbox hi! used to work fine under Windows 7. Now that I upgraded to Windows 10, it isn't working when certain windows are active. Specially LButton-Hotkeys can mess up everything, leading to the situation where you actually…
phil294
  • 10,038
  • 8
  • 65
  • 98
21
votes
6 answers

How to get the active window's title with AutoHotKey?

I wrote this short test code, but it didn't work. What am I doing wrong? F12:: WinGetTitle, Title, A ; MsgBox, "%Title%" The displayed result was ""
Kou
  • 777
  • 3
  • 8
  • 16
21
votes
3 answers

How to map caps lock to ESC in AutoHotkey?

How to set up AutoHotkey so that when I press the Caps Lock, it will instead send the ESC key to the computer?
Anonsage
  • 8,030
  • 5
  • 48
  • 51
20
votes
6 answers

Autohotkey alternative for Mac OS X?

This question has been asked before but with no answer. I'm running into brick walls with google too. Program can either be free or paid.
James Banks
  • 273
  • 1
  • 3
  • 11
19
votes
1 answer

How to concatenate a number and a string in auto hotkey

I have the following auto hotkey script: A:= 5 B := "7" C := A.B MsgBox %C% The third line does not work. I'm expecting output of "57" I have tried the following: C := %A%.%B% C := (A).(B) C := (A.B) C := (%A%.%B%) C := (%A%).(%B%) None of which…
Graham
  • 7,807
  • 20
  • 69
  • 114
19
votes
2 answers

Autohotkey, How to NOT consume the key being pressed?

In Autohotkey, I want the key pressed to serve its original purpose, while executing some additional functions. For example, upon pressing "^a", I'd like the "^a" to function as normal (e.g. Select All), and then send another "word". I tried to…
WSBT
  • 33,033
  • 18
  • 128
  • 133
18
votes
4 answers

How can I simulate the Windows Key in Autohotkey

I have an old IBM Model M from 1994. It's awesome, but it doesn't have a Windows key. I'd like to use AutoHotkey to map the combination of Ctrl + Alt to simulate the Windows key in order to take advantage of the default Windows shortcuts. Here's…
jtmcn
  • 317
  • 1
  • 3
  • 8
18
votes
11 answers

Any way to toggle between local desktop and AWS Workspace in full screen view using code or a script?

I run an AWS Workspace in full screen view, and I have my various windows and applications spread across two large monitors in Extended Desktop mode. Works just fine. But how do I toggle over to my local desktop using some automated code or…
PGilm
  • 2,262
  • 1
  • 14
  • 26
18
votes
3 answers

Does anyone have a Notepad++ plugin that will generate UUIDs and insert them

I Often need UUIDs inserted into files that I'm editing in Notepad++. Does anyone have a macro or add in that does this. Or an autohotkey script?
Charley Rathkopf
  • 4,720
  • 7
  • 38
  • 57
18
votes
3 answers

What is the key scan code of the Fn key for use in AutoHotkey (AHK)?

I want to use Fn+S to emulate Ctrl+S, and so far this is my code: #InstallKeybdHook #Persistent SC126 & s:: Send ^{s} return My problem is that I don't know the Fn key's scan code. How can I find it?
user3098326
  • 219
  • 1
  • 2
  • 10
18
votes
4 answers

Global variable does not have global scope

supposedlyGlobalVariable := "blah" ARoutine() { localVariable := "asdf" MsgBox, The global variable value is %supposedlyGlobalVariable%. The local variable value is %localVariable%. } ^!X:: ;This assigns the hotkey CTRL + ALT + X to run…
P.Brian.Mackey
  • 43,228
  • 68
  • 238
  • 348
17
votes
8 answers

How do I wait for Google Chrome to load a webpage before continuing in AutoHotkey?

I am working on a AutoHotkey script that does a repetitive job in Google Chrome. Every time that I click a link from the script, I have to tell my script to sleep while the page loads. I am wondering if there is a way in AHK for me to tell the…
Questionmark
  • 834
  • 2
  • 15
  • 26