Skip to content

Instantly share code, notes, and snippets.

@JoeGlines
Created January 14, 2024 21:11
Show Gist options
  • Save JoeGlines/d945fd68e6577c5424b6320e64c59515 to your computer and use it in GitHub Desktop.
Save JoeGlines/d945fd68e6577c5424b6320e64c59515 to your computer and use it in GitHub Desktop.
How to run Windows Apps with AutoHotkey v1
;*******************************************************
; Want a clear path for Discovering AutoHotkey; Take a look at our AutoHotkey courses.
;They"re structured in a way to make learning AHK EASY: https://the-Automator.com/Discover
;*******************************************************
#Include <default_Settings>
#Requires AutoHotkey v1.1.33+
;**************************************
runApp("Paint") ;this calls the below function and will launch the named app
runApp("WordPad") ;this calls the below function and will launch the named app
return
runApp(appName) {
;~ obj:={}
For app in ComObjCreate("Shell.Application").NameSpace("shell:AppsFolder").Items { ;Create a COM object and For-loop over them
;~ myApps.=App.Name "`r`n"
If (app.Name = appName) ;If the app.name matches what you provided
RunWait % "explorer shell:appsFolder\" app.Path ;Run it
}
;~ OutputWindow(myApps,1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment