Edit: Thanks to rommmcek for suggesting #+g::Send #g. It seems to work for bringing up the Windows 10 gaming bar.
In my early days with AutoHotkey, I spent time creating a GUI that I could open with [Win] + [G] with lots of buttons and the occasional dropdown menu to open all of my programs. But I've found that sometimes, typing is just faster than using a mouse. So I created QuickStart, a modular system that opens a very basic interface, simply a one-line edit control and button, and can be easily programmed to do anything, from opening a file or running a Steam game to copying something to the clipboard and triggering other AHK subroutines and functions. This thing must've saved me hours of my time, simply from little ten-second increments. Take this example:
Starting a Steam game without QuickStart:
1. Open Steam (For me it is usually running in the background, but the window isn't open)
2. Find the game in my Steam library (Categories help for organization, but it's still a lot of clicks)
3. Double-click the game
Starting a Steam game with QuickStart:
1. [Win] + [G] (customizable hotkey)
2. Type a quick, usually 2-3 letter abbreviation for the game and hit [Enter]
It may not sound great, but it's a whole lot faster to start a program with one keystroke than search for it in the start menu, or to navigate to any drive on your computer by simply typing that letter into a small box.
QuickStart is one of those scripts that doesn't really do a whole lot unless it's modified and maintained to fit the user's needs, but I've added in some basics to get you started and get the hang of the syntax (which is very straightforward; I mean, this is AutoHotkey we're talking about).
Like most of my other scripts, this one is split into two parts so that it can be easily integrated into an existing "main script" you may have. If QuickStart is the only script you would like to use, put both files into a folder with the following script:
Code: Select all
#InstallKeybdHook ; Better keyboard handling
#NoEnv ; Better compatibility
#SingleInstance Force ; No dialog when restarting
SendMode Input ; Faster keystrokes
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory
#Include QuickStartDef.ahk
Return ; END OF AUTO-EXECUTE SECTION
#Include QuickStart.ahk
QuickStartDef.ahk (#Include before auto-execute section)
Code: Select all
QuickStart := {}
QS_TextEditor := "C:\Program Files (x86)\Notepad++\Notepad++.exe "
{ ; Games
QuickStart.steam := "C:\Program Files (x86)\Steam\Steam.exe"
QuickStart.steamdir := "C:\Program Files (x86)\Steam\steamapps\common\"
QuickStart.ftl := "steam://rungameid/212680" ; Faster Than Light
QuickStart.ftlfiles := A_MyDocuments . "\My Games\FasterThanLight\"
QuickStart.ksp := "steam://rungameid/220200" ; Kerbal Space Program
QuickStart.sb := "steam://rungameid/211820" ; Starbound
QuickStart.se := "steam://rungameid/244850" ; Space Engineers
QuickStart.stanley := "steam://rungameid/221910" ; Stanley Parable
QuickStart.surgeonsim := "steam://rungameid/233720" ; Surgeon Simulator
}
{ ; Computer
QuickStart.pc := "::{20d04fe0-3aea-1069-a2d8-08002b30309d}"
QuickStart.c := "C:\"
QuickStart.d := "D:\"
QuickStart.e := "E:\"
QuickStart.f := "F:\"
QuickStart.ad := A_AppData
QuickStart.cmd := Func( "QS_Admin" ).Bind( "cmd.exe" )
QuickStart.cp := "Control Panel"
QuickStart.erb := Func( "QS_EmptyRecycleBin" ) ; ERB = Empty Recycle Bin
QuickStart.explorer := Func( "QS_RestartExplorer" )
QuickStart.ip := Func( "QS_CopyText" ).Bind( A_IPAddress1 )
QuickStart.pd := "C:\ProgramData\"
QuickStart.pf := "C:\Program Files\"
QuickStart.pf32 := A_ProgramFiles
QuickStart.pf86 := A_ProgramFiles
QuickStart.pfall := Func( "QS_RunMore" ).Bind( "C:\Program Files\", A_ProgramFiles ) ; Opens both "Program Files" and "Program Files (x86)"
QuickStart.shellnew := A_WinDir . "\ShellNew\"
QuickStart.startup := "shell:startup"
QuickStart.startup2 := "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\"
QuickStart.tm := "taskmgr.exe /7" ; The "/7" is to ensure that it will not take up extra taskbar space if Task Manager is already pinned
QuickStart.windir := A_WinDir
}
{ ; Windows Accessories
QuickStart.rec := "C:\Windows\Sysnative\SoundRecorder.exe"
QuickStart.snip := "C:\Windows\Sysnative\SnippingTool.exe"
QuickStart.notes := "C:\Windows\Sysnative\gStikyNot.exe"
QuickStart.vol := "SndVol.exe"
}
{ ; User Folder
QuickStart[A_UserName] := "C:\Users\" . A_UserName
QuickStart.me := "C:\Users\" . A_UserName
QuickStart.db := A_MyDocuments . "\Dropbox\"
QuickStart.desktop := "C:\Users\" . A_UserName . "\Desktop\"
QuickStart.dl := "C:\Users\" . A_UserName . "\Downloads\"
QuickStart.docs := A_MyDocuments
QuickStart.music := "C:\Users\" . A_UserName . "\Music\"
QuickStart.pics := "C:\Users\" . A_UserName . "\Pictures\"
QuickStart.vids := "C:\Users\" . A_UserName . "\Videos\"
}
{ ; AutoHotkey
QuickStart.edit := A_ScriptDir
QuickStart.editme := QS_TextEditor . A_ScriptFullPath
QuickStart.qedit := QS_TextEditor . A_ScriptDir . "\QuickStartDef.ahk" ; Edit this script to add more QuickStart stuff!
QuickStart.ahk2exe := "C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe"
QuickStart.keyhistory := Func( "QS_KeyHist" )
QuickStart.spy := "C:\Program Files\AutoHotkey\AU3_Spy.exe"
QuickStart.winspy := "C:\Program Files\AutoHotkey\AU3_Spy.exe"
}
{ ; Programs
QuickStart.blender := "C:\Program Files\Blender\blender.exe"
QuickStart.chrome := "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
QuickStart.keep := "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --profile-directory=Default --app-id=hmjkmjkepdijhoojdojkdfohbdgmmhki" ; Launches Google Keep in a separate window (requires Google Chrome)
QuickStart.movie := "C:\Program Files (x86)\Windows Live\Photo Gallery\MovieMaker.exe"
QuickStart.services := "services.msc"
QuickStart.vjcfg := "C:\Program Files\vJoy\x64\vJoyConf.exe"
QuickStart.vjfeed := "C:\Program Files\vJoy\x64\vJoyFeeder.exe"
QuickStart.vjmonitor := "C:\Program Files\vJoy\x64\JoyMonitor.exe"
QuickStart.wmp := "C:\Program Files (x86)\Windows Media Player\wmplayer.exe"
}
{ ; Modules - You can delete these unless you are using some of my other scripts
; QuickStart.googlelist := Func( "QS_GoSub" ).Bind( "GoogleGui" )
; QuickStart.googlist := Func( "QS_GoSub" ).Bind( "GoogleGui" )
; QuickStart.sort := Func( "QS_GoSub" ).Bind( "ABCGui" )
}
{ ; Websites
QuickStart.cubemix := "http://cube.crider.co.uk/scrambler.html"
QuickStart.tones := "http://wki.pe/Piano_key_frequencies" ; to be used with SoundBeep
QuickStart.viscube := "http://cube.crider.co.uk/visualcube.php"
}
QS_Admin( RunList* ) {
For RunNum, RunItem in RunList
Run *RunAs %RunItem%
}
QS_CopyText( CopyText ) {
Clipboard := CopyText
TrayTip, QuickStart v2, %CopyText% copied to clipboard
}
QS_EmptyRecycleBin() {
NumPut( VarSetCapacity( SHQUERYRBINFO,20,0 ), SHQUERYRBINFO )
DllCall( "Shell32\SHQueryRecycleBinA", Int,0, UInt,&SHQUERYRBINFO )
If (NumGet( SHQUERYRBINFO, 0 ? 12 : 4,"Int64" )) {
FileRecycleEmpty
SoundPlay C:\Windows\media\recycle.wav
}
}
QS_GoSub( Subroutine ) {
GoSub %Subroutine%
}
QS_KeyHist() {
KeyHistory
}
QS_ShowMenu( MenuName ) {
Menu, %MenuName%, Show
}
QS_RestartExplorer( WaitTime = 100 ) {
PostMessage, 0x12, 0, 0, , ahk_exe explorer.exe ; WM_Quit
Sleep %WaitTime%
PostMessage, 0x12, 0, 0, , ahk_exe explorer.exe ; WM_Quit
Sleep %WaitTime%
Run %A_Windir%\explorer.exe
}
QS_RunMore( RunList* ) {
For RunNum, RunItem in RunList
Run %RunItem%
}
Code: Select all
#g::
Gui, Destroy
Gui, Font, s11, Consolas
Gui, Add, Edit, x5 y5 w200 h25 vQuickStartQuery, %LastQSQuery%
Gui, Add, Button, x210 y5 w25 h25 +Default gQuickStartGo, →
Gui, Show, w240 h35, QuickStart v2
Gui, Font
Return
; #+g::#g ; "Gamer bar" Win10 compatibility attempt doesn't work :(
QuickStartGo:
Gui, Submit
Gui, Destroy
If ( QuickStart[QuickStartQuery] ) {
If QuickStart[QuickStartQuery] is alnum
Run % QuickStart[QuickStartQuery]
Else QuickStart[QuickStartQuery].Call()
LastQSQuery := QuickStartQuery
}
Else
SoundPlay *-1
Return
; Escape if these labels they are already used by the main script
GuiClose:
GuiEscape:
Gui, Destroy
Return
Changelog