Making Win+num cycle through windows, not applications

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
dimension11
Posts: 4
Joined: 15 Mar 2018, 09:29

Making Win+num cycle through windows, not applications

15 Mar 2018, 10:43

I'd like to make the Win+num keyboard shortcut cycle through all open windows individually, i.e. without grouping them by application. I.e. if I have the following windows on the taskbar:
  • Chrome -- "Example Window 1"
  • Firefox -- "Example Window 2"
  • Firefox -- "Example Window 3"
  • File Explorer -- "Example Window 4"
Then I want "Win+3" to open "Example Window 3", and "Win+4" to open "Example Window 4".

(Currently, the two Firefox windows are grouped together, so "Win+3" opens "Example Window 4" because File Explorer is the third application, and "Win+4" does nothing, since there are only three programs on the taskbar.)

My code right now is this:

Code: Select all

#2::
   Send, #T
   Send, #T
   Send, {enter}
Return
#3::
   Send, #T
   Send, #T   
   Send, #T
   Send, {enter}
Return
#4::
   Send, #T
   Send, #T
   Send, #T   
   Send, #T
   Send, {enter}
Return
...
#9::
   Send, #T
   Send, #T
   Send, #T
   Send, #T
   Send, #T
   Send, #T
   Send, #T
   Send, #T   
   Send, #T
   Send, {enter}
Return
But it just doesn't seem to work.

Any help?
User avatar
Micromegas
Posts: 260
Joined: 28 Apr 2015, 23:02
Location: Germany

Re: Making Win+num cycle through windows, not applications

15 Mar 2018, 15:30

Check out WinActivate, which allows you to be very specific about which window you open.
dimension11
Posts: 4
Joined: 15 Mar 2018, 09:29

Re: Making Win+num cycle through windows, not applications

15 Mar 2018, 21:54

Micromegas wrote:Check out WinActivate, which allows you to be very specific about which window you open.
My impression is that WinActivate allows you to choose a window based on its title and its contents. This is not what I want -- I want to choose a window based on its position in the taskbar.
User avatar
Micromegas
Posts: 260
Joined: 28 Apr 2015, 23:02
Location: Germany

Re: Making Win+num cycle through windows, not applications

09 Apr 2018, 08:37

Microsoft offers a setting for what you want to do: Why don't you just set the Taskbar properties to Taskbar buttons: Never combine?
dimension11
Posts: 4
Joined: 15 Mar 2018, 09:29

Re: Making Win+num cycle through windows, not applications

09 Apr 2018, 21:18

Micromegas wrote:Microsoft offers a setting for what you want to do: Why don't you just set the Taskbar properties to Taskbar buttons: Never combine?
Doesn't help -- in fact, that's the exact setting I have enabled, and it's why I want win+num to cycle through windows instead of applications.
User avatar
Micromegas
Posts: 260
Joined: 28 Apr 2015, 23:02
Location: Germany

Re: Making Win+num cycle through windows, not applications

11 Apr 2018, 02:50

I see. You could help people here help you if you provided such information before being asked.

Windows 10 is somewhat quirky with the handling of those buttons. Indeed, I could not find a way to select a given button other than by invoking Win+num or Win+T. That makes this a special problem with no other practical use, and since WinActivate works perfectly well for all my applications, I'm less interested in finding a solution. But you might motivate someone to help you if you could explain what advantage you see in this particular way of activating a window.
User avatar
Micromegas
Posts: 260
Joined: 28 Apr 2015, 23:02
Location: Germany

Re: Making Win+num cycle through windows, not applications

11 Apr 2018, 03:10

On second thought, you might try to send #t rather than #T. Also, include a short pause like sleep 200 before you send {enter}.

Here, too, you could have had the answer much sooner if you had described the symptom that your #T moves backwards, instead of just writing "it just doesn't seem to work."

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: aitaixy, dangoscrub, doodles333, Google [Bot], joedf, Nerafius and 90 guests