QuickStart - A straightforward, customizable launcher

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
Hactar
Posts: 12
Joined: 23 Jul 2015, 20:59

QuickStart - A straightforward, customizable launcher

25 Jul 2015, 12:37

Note: Windows 10 introduced a new "gaming toolbar," opened with [Win] + [G]. If you want to use [Win] + [G] for your gaming bar, you can remap QuickStart. If you want to use [Win] + [Shift] + [G] for the gaming bar (like me) or some other hotkey... well, #+g::#g doesn't seem to work. Please reply if you manage to remap the gaming bar to something else!
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
Okay, now onto the actual code!


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%
}
QuickStart.ahk (#Include after auto-execute section)

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
Last edited by Hactar on 30 May 2016, 06:42, edited 4 times in total.
User avatar
rommmcek
Posts: 1473
Joined: 15 Aug 2014, 15:18

Re: QuickStart - A straightforward, customizable launcher

12 Mar 2016, 23:03

If you want to use [Win] + [Shift] + [G] for the gaming bar (like me) or some other hotkey... well, #+g::#g doesn't seem to work.
Try: #+g::Send, #g
toomeny
Posts: 2
Joined: 29 May 2016, 01:59

Re: QuickStart - A straightforward, customizable launcher

29 May 2016, 05:44

I haven't been using AutoHotkey for long, but this script is already a life saver.

However the following shortcut in QuickStartDef.ahk doesn't work for me.

Code: Select all


{ ; AutoHotkey

QuickStart.qcount				:= Func( "QS_Count" )

}

I have only a basic understanding of the AHK language, but I can't find the "QS_Count" function in any of the codes, what is this used for?

Thank you for the great launcher, I'm collecting all my AHK scripts around this code as a foundation and so far it's worked wonders.
User avatar
Hactar
Posts: 12
Joined: 23 Jul 2015, 20:59

Re: QuickStart - A straightforward, customizable launcher

30 May 2016, 06:41

toomeny wrote:I haven't been using AutoHotkey for long, but this script is already a life saver.

However the following shortcut in QuickStartDef.ahk doesn't work for me.

Code: Select all


{ ; AutoHotkey

QuickStart.qcount				:= Func( "QS_Count" )

}

I have only a basic understanding of the AHK language, but I can't find the "QS_Count" function in any of the codes, what is this used for?

Thank you for the great launcher, I'm collecting all my AHK scripts around this code as a foundation and so far it's worked wonders.
Hm, that's odd. That line isn't in my own script, and I can only guess at what it does...
(I'll remove it from the OP.)

Thank you; I appreciate your appreciation. ;)
av930
Posts: 31
Joined: 24 Dec 2017, 10:21

Re: QuickStart - A straightforward, customizable launcher

06 Jan 2018, 00:48

Hello. Hactar.
I'd like to use your QuickStart script for general use.
it fits for me, I think.
but It not working. How I can use it?
when I run it and to launch explorer d-drive, I push #G, d, enter.
Nothing happened....
Is this script have GUI, it also doesn't show up.

OS: windows 10

Please how I can test if this program is working correctly?
I am newbie to AHK.
please...
HactarCE

Re: QuickStart - A straightforward, customizable launcher

06 Jan 2018, 09:56

av930 wrote:Hello. Hactar.
I'd like to use your QuickStart script for general use.
it fits for me, I think.
but It not working. How I can use it?
when I run it and to launch explorer d-drive, I push #G, d, enter.
Nothing happened....
Is this script have GUI, it also doesn't show up.

OS: windows 10

Please how I can test if this program is working correctly?
I am newbie to AHK.
please...
It's probably interfering with the Windows gaming bar. Try changing

Code: Select all

#g::
to something like

Code: Select all

#Space::
(Win+Space is what I've been using).
av930
Posts: 31
Joined: 24 Dec 2017, 10:21

Re: QuickStart - A straightforward, customizable launcher

14 Jan 2018, 09:19

Hactar. I also have a question below code.

I added a condition and object that only work specific program.
In addition, I divided into 2 file, QuickStart_forAndroidStudio.ahk and QuickStart_defaultSystem,ahk
but it is a bit ugly, I'd like know about smart way do this, such as "runtime object loading conditionly" or "load static time and runtime change the object conditionaly"
please help me.



#q::
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


;;Specific program purpose
;;Msgbox, % AndroidStudio[QuickStartQuery]
IfWinActive, ahk_exe studio64.exe
{
If ( AndroidStudio[QuickStartQuery] ) {
If AndroidStudio[QuickStartQuery] is alnum {
;;Send % AndroidStudio[QuickStartQuery]
Exec( AndroidStudio[QuickStartQuery] )

}
Else { ;;;; function matched
AndroidStudio[QuickStartQuery].Call()
}
LastQSQuery := QuickStartQuery
return
}
}


;;General purpose
;;Msgbox, % QuickStart[QuickStartQuery]
If ( QuickStart[QuickStartQuery] ) { ;;;; just run command ex:path, program, url
If QuickStart[QuickStartQuery] is alnum {
;;Send % QuickStart[QuickStartQuery]
;;cmd := QuickStart[QuickStartQuery]
Exec( QuickStart[QuickStartQuery] )
}
Else { ;;;; function matched
QuickStart[QuickStartQuery].Call()
}
LastQSQuery := QuickStartQuery
}
Else{ ;;;; nothing matched
SoundPlay *-1
}

Return
av930
Posts: 31
Joined: 24 Dec 2017, 10:21

Re: QuickStart - A straightforward, customizable launcher

14 Jan 2018, 09:22

Posting is failed, therefore I rewrite again.---

Hactor I found the issue.
when i open QuickStart file from Notepad++, line number 6, there is ending →
Gui, Add, Button, x210 y5 w25 h25 +Default gQuickStartGo, →
this character makes issue. please refer it.


#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
av930
Posts: 31
Joined: 24 Dec 2017, 10:21

Re: QuickStart - A straightforward, customizable launcher

15 Jan 2018, 23:44

Code: Select all

RunAction( Menu, Sleep, Key ) {
	;;MsgBox, %Menu%, %Sleep%, %Key%
	SendInput, %Menu%

	WinWaitActive, ahk_class SunAwtDialog ahk_exe studio64.exe
	Sleep %Sleep%
	SendInput, {delete}%Key%
	WinWaitClose, ahk_class SunAwtDialog ahk_exe studio64.exe
}
I change your code to a fuction "RunAction".
and put some sleep as 2nd parameter "Sleep", because there are a popups launched a bit delayed.
Even though it still ignore starting character. when I put text "Keymap", the popup only receive only "eymap".
I guess there is no good way anymore...

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: hisrRB57 and 82 guests