Help to assign a HotKey to run Chrome Apps (browser shortcuts that run as windows)

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
User avatar
entropy
Posts: 93
Joined: 17 Oct 2014, 01:45

Help to assign a HotKey to run Chrome Apps (browser shortcuts that run as windows)

Post by entropy » 27 Mar 2023, 13:04

Thanks to this topic viewtopic.php?f=82&t=115441 I managed to rewrite all my scripts using functions instead of repeating the code.
However, no matter what I tried, I failed to integrate this code with functions and run Chrome Apps.

Code: Select all

#F1::
{ 
If WinExist("Translate")
   If WinActive()
      WinMinimize
   Else WinActivate
Else
   Run '"C:\Program Files (x86)\Google\Chrome\Application\chrome_proxy.exe" --profile-directory="Profile 1" --app-id=hojgkbboeffaoafihofamffoahaekkkk'
}
Can someone help?
Thanks!
when I run this path (the same as above) with windows run command Google Trabslate starts.
"C:\Program Files (x86)\Google\Chrome\Application\chrome_proxy.exe" --profile-directory="Profile 1" --app-id=hojgkbboeffaoafihofamffoahaekkkk

The following code, and many similar, is running smoothly:

Code: Select all

+Esc::toggleWindow('C:\Program Files\AutoHotkey\SciTE\SciTE.exe', 'ahk_class SciTEWindow')
toggleWindow(appNameOrPath, winTitle) {
 If WinExist(winTitle)
  If WinActive()
   WinMinimize(), MouseGetPos(,, &hWnd), WinActivate(hWnd)
  Else WinActivate
 Else runApp(appNameOrPath)
}

runApp(appNameOrPath) {
 If !FileExist(appNameOrPath) {
  For app in ComObject('Shell.Application').NameSpace('shell:AppsFolder').Items
   (app.Name = appNameOrPath) && RunWait('explorer shell:appsFolder\' app.Path)
 } Else Run(appNameOrPath)
}

User avatar
tiska
Posts: 15
Joined: 21 Mar 2024, 10:48

Re: Help to assign a HotKey to run Chrome Apps (browser shortcuts that run as windows)

Post by tiska » Yesterday, 22:11

Have you found a solution to this? I am trying to do the same and have had no success either...

User avatar
entropy
Posts: 93
Joined: 17 Oct 2014, 01:45

Re: Help to assign a HotKey to run Chrome Apps (browser shortcuts that run as windows)

Post by entropy » Today, 00:05

The code I posted for running Google Translate works for me. Have you tried it?

User avatar
tiska
Posts: 15
Joined: 21 Mar 2024, 10:48

Re: Help to assign a HotKey to run Chrome Apps (browser shortcuts that run as windows)

Post by tiska » Today, 00:54

I made some changes and now it works for me

Code: Select all

#Requires AutoHotkey 2.0.2+
#SingleInstance
Persistent

F8::
{ 
If WinExist("ChatGPT")
   If WinActive()
      WinMinimize
   Else WinActivate
Else
   Run ("C:\Users\USERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Chrome Apps\ChatGPT.lnk")
}

Post Reply

Return to “Ask for Help (v2)”