I'm trying to integrate some test equipment and need a bit of guidance on part of the script. The test equipment outputs a .csv file like this:
1a2b3c44 > configuration #1
aa263ee248ce > new configuration #3
-1a3e4d5f2n > delete this configuration
xxxefff > last configuration
For the gui part of this script, I need to parse each line, join the first parts (before the '>') and populate a combobox. I was hoping to have the part after the '>' fill in a text field in the gui. see attached screenshot.
https://www.dropbox.com/s/pk5046l5ezxgd ... x.jpg?dl=0
Here is the rfelevant part of the code:
Code: Select all
; =======================================================================================
; Name ..........: Shortcuts.ahk
; Description ...: Hotkey script to load/save strings
; AHK Version ...: AHK_L 1.1.26.00 (Unicode 64-bit)
; Author ........: Steve Trebotich ([email protected])
; =======================================================================================
; Changelog =============================================================================
; Legend: (+) NEW, (*) CHANGED, (!) FIXED
; ---------------------------------------------------------------------------------------
; YYYY-MM-DD FirstName LastName <[email protected]>
; + Change Description
; ---------------------------------------------------------------------------------------
; YYYY-MM-DD FirstName LastName <[email protected]>
; + Change Description
; =======================================================================================
;++++++++++++++++
; ++++To Do's++++
; Fix GUI
; Read/Write 2 variables to ini file
; Edit/New entries
; Setup "Today" to insert today's date
; Global ================================================================================
#SingleInstance, Force ; Allow only one running instance of script
#Persistent ; Keep script permanently running until terminated
#NoEnv ; Avoid checking empty variables to see if they are environment variables
#Warn ; Enable warnings to assist with detecting common errors
#NoTrayIcon ; Disable the tray icon of the script
SendMode, Input ; Recommended for new scripts due to its superior speed and reliability
SetWorkingDir, %A_ScriptDir% ; Change the working directory of the script
SetBatchLines, -1 ; Run script at maximum speed
F6::
MouseGetPos, LocX, LocY
newlines =
FileDelete, newlines.txt
Loop, Read, shortcuts.csv
{
RegExMatch(A_LoopReadLine, "^(.*?)>", lines)
StringTrimRight, lines, lines, 2
newlines = %lines%|
FileAppend, %newlines%, newlines.txt
}
FileRead, combolines, newlines.txt
; Gui, Add, ComboBox, x10 y30 w100 h10 , %combolines%
; Gui, Add, Combobox, gparseit, %combo1%
Gui, Add, ComboBox, , %combolines%
; Gui, Add, ComboBox, x125 y30 w200 h10 , ComboBox
; Gui, Add, Text, x10 y10 w100 h20 +Center, Category
; Gui, Add, Text, x150 y10 w100 h20 +Center, Item(s)
Gui, Add, Text, , %combolines%
Gui, Add, Button, x92 y140 w50 h20 , Go!
Gui, Add, Button, x162 y140 w60 h20 , Cancel
; Gui, Show, X%LocX% Y%LocY% h200 w335,
Gui, Show
; GuiControl, Choose, %combolines%, 0
; Return
; parseit:
; combo1 := SubStr(combo, combolines, 2)
; msgbox, %combo1%
return
thanks