I should read the OP probably, but from the image, is your intention to show multiple windows on the screen, tiled, navigated to the right tabs.
Re. the tab control/tab headers.
- I believe that the control I asked about is probably a SysTabControl32, when you do ControlGetText they show nothing I believe (based on a test I did).
- When I go to 'Tools, Internet options', AccViewer does not show information that identifies what the active tab is (although this can be retrieved via a message as shown earlier, TCM_GETCURSEL), although it can retrieve the text from the tab headers.
Your code looks pretty good. Personally I would do:
Code: Select all
;one of:
if (vSelection <> 4)
if (vSelection != 4)
if !(vSelection = 4)
if (vSelection = 4)
if (vSelection = "string")
if (vSelection = var)
;one of:
vSelection := vSelection-1
vSelection -= 1
vSelection--
--vSelection
Btw the use of 'v' for variables, is very much a 'me' thing, I didn't invent the notation, although I rarely see it on the forums, but you're welcome to use it, or not use it.
In all my time with AHK, I didn't know this was possible, although it does make sense cf. what you can do with parameters:
Did you see that somewhere?
Haha yeah syntax can be tricky ...
I might release some AHK tutorials this week/next week.
==================================================
Re. choose. There are too many ways to do this, and I may have made a mistake somewhere below, anyhow, I think AHK should decide what it recommends. Although I don't personally require or want a new choose syntax, it's not an unreasonable wish list item.
Code: Select all
q:: ;choose
vSelection := 3
vLabel := ""
oArray := ["Prolog","Metadata","Data","Epilog"]
if vSelection in 1,2,3,4
vLabel := oArray[vSelection]
MsgBox, % vLabel
if (vSelection = 1)
vLabel := "Prolog"
else if (vSelection = 2)
vLabel := "Metadata"
else if (vSelection = 3)
vLabel := "Data"
else if (vSelection = 4)
vLabel := "Epilog"
else
vLabel := ""
;split across multiple lines:
;multiple ternary operators:
vLabel := ""
(vSelection = 1) ? (vLabel := "Prolog")
: (vSelection = 2) ? (vLabel := "Metadata")
: (vSelection = 3) ? (vLabel := "Data")
: (vSelection = 4) ? (vLabel := "Epilog") : ""
MsgBox, % vLabel
;split across multiple lines:
;multiple ternary operators:
vLabel := (vSelection = 1) ? "Prolog"
: (vSelection = 2) ? "Metadata"
: (vSelection = 3) ? "Data"
: (vSelection = 4) ? "Epilog"
: ""
MsgBox, % vLabel
;in AHK v2 for ternary operator you have to specify both branches
;so the 2nd branch does nothing
vLabel := ""
(vSelection = 1) ? (vLabel := "Prolog") : ""
(vSelection = 2) ? (vLabel := "Metadata") : ""
(vSelection = 3) ? (vLabel := "Data") : ""
(vSelection = 4) ? (vLabel := "Epilog") : ""
MsgBox, % vLabel
;hacky unofficial way
vLabel := ""
(vSelection = 1) && (vLabel := "Prolog")
(vSelection = 2) && (vLabel := "Metadata")
(vSelection = 3) && (vLabel := "Data")
(vSelection = 4) && (vLabel := "Epilog")
MsgBox, % vLabel
return