And a .pdf version with easy column copying in case that helps:
My reasoning is, if I can identify something unique to each of these contexts (highlighted in gold, not finished atm because there are more of these), then I'll be able to use RegExMatch to determine which context I'm in and I can then draw the correct parameters from the correct Edit controls. I've successfully done this:
Code: Select all
; Find Artboard
+F24::
match := []
WinGet, ControlList, ControlList, A
Artboard := ""
vOutput := ""
p := 1, m := ""
while p := RegExMatch(ControlList, "(Edit[0-9]+)", m, p + StrLen(m)) {
match%A_Index% := m1
finalCount := A_Index
}
Loop, 40
{
CurrMatch := (A_Index + 100) ; This control is always in the 100 to 140 range
ControlGetText, conMatch, % match%CurrMatch%, ahk_class illustrator
If (RegExMatch(conMatch, "(Artboard)$") != 0)
{
Artboard := match%currMatch%
}
}
MsgBox % vOutput
Return
Code: Select all
; variables are global
ScanForEdits(){
match := []
WinGet, ControlList, ControlList, A
Artboard := ""
vOutput := ""
p := 1, m := ""
while p := RegExMatch(ControlList, "(Edit[0-9]+)", m, p + StrLen(m)) {
match%A_Index% := m1
finalCount := A_Index
}
Loop, 40
{
CurrMatch := (A_Index + 100)
ControlGetText, conMatch, % match%CurrMatch%, ahk_class illustrator
If (RegExMatch(conMatch, "(Artboard)$") != 0)
{
Artboard := match%currMatch%
}
; ; Always reports 125
; If (RegExMatch(conMatch, "(ock)$") != 0)
; {
; StockVar := match%currMatch%
; }
}
; Always reports 125
; Loop, 40
; {
; CurrMatch := (A_Index + 100)
; ControlGetText, conMatch, % match%CurrMatch%, ahk_class illustrator
; If (RegExMatch(conMatch, "(ock)$") != 0)
; {
; StockVar := match%currMatch%
; }
; }
Return
}
Code: Select all
Loop, 40
{
CurrMatch := (A_Index + 100)
ControlGetText, conMatch, % match%CurrMatch%, ahk_class illustrator
If (RegExMatch(conMatch, "(Artboard)$") != 0)
{
Artboard := match%currMatch%
}
}
Loop, % finalCount
{
CurrMatch := A_Index
ControlGetText, conMatch, % match%CurrMatch%, ahk_class illustrator
If (RegExMatch(conMatch, "(ock)$") != 0)
{
StockNum := match%currMatch%
}
}