1
votes

I have this autohotkey script that opens chrome if its not already on windows, and if it is, cycles through tabs within it. It also puts that chrome window on top of any other windows (e.g. excel docs, word docs, etc)

IfWinNotExist, ahk_class Chrome_WidgetWin_1
    Run, chrome.exe
if WinActive("ahk_class Chrome_WidgetWin_1")
    Send ^{tab}
else
    WinActivate ahk_class Chrome_WidgetWin_1
Return

I can't seem to figure out how to get this to work for google chromium though. Both exe names are "chrome.exe", so I'm not sure what the run commands is if there's an overlap.

Also, I ran winSpy but still am not 100% sure what ahk_class name is. Below is the information from winSpy

enter image description here

1

1 Answers

0
votes

I ended up settling for a different solution

After 2 days of tweaking and testing some workflows, this is what I settled with. I ran a combination of both phrase-express (any macro program works here) and autohotkey here, so I can have an extremely flexible layout

F1 → Binded to WIN+1 key
F2 → Binded to WIN+2 key
F3 → Binded to Win+4 key
F4 → Binded to Win+4 key

For F5 to F7 keys, I used autohotkey

F5::
IfWinNotExist, ahk_class Chrome_WidgetWin_1
    Run, chrome.exe
GroupAdd, kjexplorers5, ahk_class Chrome_WidgetWin_1 ;You have to make a new group for each application, don't use the same one for all of them!
if WinActive("ahk_exe chrome.exe")
    GroupActivate, kjexplorers5, r
else
    WinActivate ahk_class Chrome_WidgetWin_1 ;you have to use WinActivatebottom if you didn't create a window group.
Return

F6::
IfWinNotExist, ahk_class ConsoleWindowClass
    Run, cmd.exe
GroupAdd, kjexplorers6, ahk_class ConsoleWindowClass ;You have to make a new group for each application, don't use the same one for all of them!
if WinActive("ahk_exe cmd.exe")
    GroupActivate, kjexplorers6, r
else
    WinActivate ahk_class ConsoleWindowClass ;you have to use WinActivatebottom if you didn't create a window group.
Return

F7::
IfWinNotExist, ahk_class QWidget
    Run, anki.exe
GroupAdd, kjexplorers7, ahk_class QWidget ;You have to make a new group for each application, don't use the same one for all of them!
if WinActive("ahk_exe anki.exe")
    GroupActivate, kjexplorers7, r
else
    WinActivate ahk_class QWidget ;you have to use WinActivatebottom if you didn't create a window group.
Return

F5 to F7 uses the same variant autohotkey, I just changed up the groupnames, the .exe files , and the ahk_class names.

This is how I organize the structure of my windows taskbar

enter image description here

So I press

  • F5 (3 times), and it pushes each chrome window I have up to the top of each of my 3 monitors.
  • F6 and I can quickly pop out whatever command prompts I have open, one command prompt for gulp commands, and one for git, independent of any IDE.
  • F7 twice to quickly add some new flashcards

I can restructure F1 F2 F3 F4 to whatever app I'm currently using. Anything that goes here I only keep one window per app at a time. Like I only run one firefox window (to watch tutorial youtube videos), only one running application of PHPstorm, etc.

Demonstration of F6 key in action (command prompt)

enter image description here