Skip to content

Instantly share code, notes, and snippets.

@CurtisAccelerate
Last active February 16, 2025 09:56
Show Gist options
  • Save CurtisAccelerate/329c256304eaff7680d4aa546b8a12f5 to your computer and use it in GitHub Desktop.
Save CurtisAccelerate/329c256304eaff7680d4aa546b8a12f5 to your computer and use it in GitHub Desktop.
Popup ChatGPT AHK
Updated-- the ChatGPT is a UWP which has implications for the "on open" functionality.
; -----------------------------------------------
; ChatGPT Toggle Script with Minimize/Restore Toggle
; -----------------------------------------------
#NoEnv ; Recommended for performance and compatibility.
SendMode Input ; Use faster, more reliable input.
SetWorkingDir %A_ScriptDir% ; Ensure a consistent starting directory.
; Set the full UWP AUMID for ChatGPT
; Replace with the correct AUMID from 'Get-StartApps'
UWPAppAUMID := "OpenAI.ChatGPT-Desktop_2p2nqsd0c76g0!ChatGPT"
; Toggle ChatGPT window with Win+C
#c::
if WinExist("ahk_exe ChatGPT.exe")
{
; If the ChatGPT window is currently active, minimize it.
if WinActive("ahk_exe ChatGPT.exe")
{
WinMinimize, ahk_exe ChatGPT.exe
}
else
{
; Otherwise, restore (in case it's minimized) and activate it.
WinRestore, ahk_exe ChatGPT.exe
WinActivate, ahk_exe ChatGPT.exe
}
}
else
{
; Launch the UWP ChatGPT app using its full AUMID.
Run, % "explorer.exe shell:AppsFolder\" . UWPAppAUMID
}
return
; Reload the script with Ctrl+Alt+R
^!r::
Reload
Tooltip, Script reloaded!
Sleep, 1000
Tooltip ; Clear the tooltip after 1 second.
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment