Child window activation script

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
blad4
Posts: 307
Joined: 07 Oct 2015, 11:06

Child window activation script

Post by blad4 » 11 Sep 2021, 12:05

I have a 2 screen setup for a program, with 80 child windows and call child windows like this:

WinGet, winList, List, ahk_class ...
WinMenuSelectItem, % "ahk_id " winList%a_index%, , CW, %ch2%&
WinGet, winList, List, ahk_class ...
Loop % winList
WinMenuSelectItem, % "ahk_id " winList%a_index%, , CW, %ch1%&
return

where ch1 is the number for the left screen, so it is the one in focus after the command is sent.

First 40 CWs are organised on the left screen, second 40 on the right screen.

At the moment I am making labels of the combination such as:

xyz1:
Ch1=1
Ch2=9
check=xyz1

And then just using 'If' statements recognise the check label. It's very laborious.

I am wondering if there is a smarter way to make a script in which I can play with the combos themselves.

1-8 A
9-16 B
17-24 C
25-32 D
33-40 E

Are on Screen 1

41-48 F
49-56 G
57-64 H
65-72 I
73-80 J

Are on Screen 2

Start would be 1,41

Every time we pressed right, we would get 9,49 then 25,41 then 17,49 then 33,57 then back to 1,41

If we pressed left at the start, we would get 33,57 then 17,49 then 25,41 then 9,49 then back to 1,41

If we kept pressing up, we would do a mod(8) of the numbers then add 1, resulting in for example

1,41 to 2,42 to 3,43 to 4,44 .. 8,48 back to 1,41

Keep pressing up would just do the reverse of the above^

***

Two extra caveats:

I use another single button to simply go back to the 'start' of the set... for example if we were at 3,43
and I press the button, we'd go back to 1,41. This is universal

Lastly, Screen two must be able to jump between two different numbers which are both connected to the number
active on Screen one.

Example: 1,41 must be able to, via a separate button again (which toggles), go to 1,73, then back to 1,41 etc.

Return to “Ask for Help (v1)”