This outstanding script is exactly what I'm trying to do, except with 4 ListBoxes instead of 2 ListBoxes: viewtopic.php?p=65674#p65674
When I tried to modify the script to add 4 ListBoxes, it still only displays 2 ListBoxes. I think where I'm stuck is in changing the size of the Gui display so that it can fit all 4 ListBoxes.
Here's what I've tried:
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Win+Shift+C - Combo Box
#+c::
Gui Add, ListBox, 8 x16 y40 w200 h290 vAction gAction multi, PREPARE|REVIEW AND ANALYZE|REVISE AND EDIT
Gui Add, Button, Default x16 y336 w54 h36 gInputUTI, Insert Action
Gui Font, s14 Bold c0xFF0000
Gui Add, Text, x16 y8 w120 h23 +0x200, Action:
Gui Font
Gui Add, ListBox, 8 x264 y40 w200 h290 vDocument gDocument multi, CORRESPONDENCE|DOCUMENTS|COMPLAINT|ANSWER|CROSS-COMPLAINT|.
Gui Add, Button, x264 y336 w51 h36 gInputDUTI, Insert Document
Gui Font, s14 Bold c0x00FF40
Gui Add, Text, x264 y8 w120 h23 +0x200, Document:
;
Gui Add, ListBox, 8 x16 y40 w200 h290 vToFrom gToFrom multi, TO|FROM|{Space}
Gui Add, Button, Default x16 y336 w54 h36 gInputUTI, Insert ToFrom
Gui Font, s14 Bold c0xFF0000
Gui Add, Text, x16 y8 w120 h23 +0x200, ToFrom:
Gui Font
Gui Add, ListBox, 8 x264 y40 w200 h290 vPerson gPerson multi, OPPOSING COUNSEL FOR|CLIENT|.
Gui Add, Button, x392 y370 w75 h23 gInputDUTI, Insert Person
Gui Font, s14 Bold c0x00FF40
Gui Add, Text, x264 y8 w120 h23 +0x200, Person:
;
Gui Font
Gui Add, Button, w500 h100 gInputExit, Exit
; Having issue with the code to insert both complaints and clicks
; with 1 button... Do I Label section ComplaintDenies: and combine both inputs?
Gui Add, Button, x392 y340 w75 h23 gInputChartExit, Insert All
::/uti::
Gui Show, w481 h400, Window
Return
Action:
if A_GuiControlEvent <> DoubleClick
return
GuiControlGet, Action ; Retrieve the ListBox's current selection.
; Send, !{Esc} ; ???
Sleep, 200
SendInput, %Action%
Return
InputUTI:
Gui, Submit, NoHide
Send, !{Esc}
Sleep, 200
StringReplace, Action, Action, |,`,%A_Space%, All
SendInput, %Action%{Space}
Gui, Hide
Return
Document:
if A_GuiControlEvent <> DoubleClick
return
GuiControlGet, Document ; Retrieve the ListBox's current selection.
;Send, !{Esc}
Sleep, 200
SendInput, %Document%{Space}
InputDUTI:
Gui, Submit, Hide
;Send, !{Esc}
Sleep, 200
; *LAlt::
; Send, {Space} ; This line sends keystrokes to the active (foremost) window.
StringReplace, Document, Document, |,`,%A_Space%, All
SendInput, %Document%{Space}
Gui, Hide
Return
ToFrom:
if A_GuiControlEvent <> DoubleClick
return
GuiControlGet, ToFrom ; Retrieve the ListBox's current selection.
; Send, !{Esc} ; ???
Sleep, 200
SendInput, %ToFrom%
Return
;InputUTI:
Gui, Submit, NoHide
Send, !{Esc}
Sleep, 200
StringReplace, ToFrom, ToFrom, |,`,%A_Space%, All
SendInput, %ToFrom%{Space}
Gui, Hide
Return
Person:
if A_GuiControlEvent <> DoubleClick
return
GuiControlGet, Person ; Retrieve the ListBox's current selection.
;Send, !{Esc}
Sleep, 200
SendInput, %Person%{Space}
;InputDUTI:
Gui, Submit, Hide
;Send, !{Esc}
Sleep, 200
; *LAlt::
; Send, {Space} ; This line sends keystrokes to the active (foremost) window.
StringReplace, Person, Person, |,`,%A_Space%, All
SendInput, %Person%{Space}
Gui, Hide
Return
InputExit:
Gui, Submit, Hide
;Send, !{Esc}
Gui, Hide
Return
InputChartExit:
Gui, Submit, Hide
StringReplace, Action, Action, |,`,%A_Space%, All
StringReplace, Document, Document, |,`,%A_Space%, All
StringReplace, ToFrom, ToFrom, |,`,%A_Space%, All
StringReplace, Person, Person, |,`,%A_Space%, All
SendInput, %Action%{Space}
SendInput, %Document%{Space}
SendInput, %ToFrom%{Space}
SendInput, %Person%{Space}
Return