Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Run a program with a keyboard shortcut with AutoHotKey
; This is a simple and pretty generic example of an AutoHotkey script to run a
; program when you press a keyboard shortcut. Add as many of these as you want
; to a .ahk file, and set that to be run at startup.
; See the Hotkeys reference [1] for details of the modifiers and keys available.
; [1]: http://www.autohotkey.com/docs/Hotkeys.htm
; Win+Alt+G - Open Gmail in Chrome
#!g::
Run "C:\Program Files\Google\Chrome\Application\chrome.exe" --app="https://mail.google.com/mail/"
Return
; Win+Shift+Break - Edit this file
#+Break::
Run "c:\Program Files\Vim\vim73\gvim.exe" "d:\AutoHotkey.ahk"
Return
@cybertelx

This comment has been minimized.

Copy link

cybertelx commented Feb 23, 2018

Cool. This is amazing! Thank you for this script, I really needed it!

@grand-lotus-iroh

This comment has been minimized.

Copy link

grand-lotus-iroh commented Feb 27, 2018

Thanks! I used this as a foundation for composing email with hotkey CTRL + ` (accent mark).

@ghost

This comment has been minimized.

Copy link

ghost commented Oct 15, 2018

How to open a program by type?

@JuanmaMenendez

This comment has been minimized.

Copy link

JuanmaMenendez commented Apr 5, 2019

I create a script similar to this but a little more advanced and it works as well with Chrome Shortcuts Apps
https://github.com/JuanmaMenendez/AutoHotkey-script-Open-Show-Apps

@codycodes

This comment has been minimized.

Copy link

codycodes commented Apr 23, 2019

@JuanmaMenendez exactly what I was looking for. Thank you for making it easy to switch between apps using keyboard shortcuts!

@sittingpilgrim

This comment has been minimized.

Copy link

sittingpilgrim commented Jun 22, 2019

@JuanmaMenendez - Thanks for coming up with this solution to the problem of multiple processes being launched

@JuanmaMenendez

This comment has been minimized.

Copy link

JuanmaMenendez commented Jun 22, 2019

Thanks, @codycodes, @sittingpilgrim and @davejamesmiller for the inspiration. Remember that with my script you also can switch between open windows of the same App pressing Alt + ` (key above Tab key) like in Mac OS. If you give a star to my repo I will be very grateful ;)

@hophiducanh

This comment has been minimized.

Copy link

hophiducanh commented Nov 7, 2019

Thanks, @codycodes, @sittingpilgrim and @davejamesmiller for the inspiration. Remember that with my script you also can switch between open windows of the same App pressing Alt + ` (key above Tab key) like in Mac OS. If you give a star to my repo I will be very grateful ;)

Both are great! Thank for your share.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.