. thank you, here an example : run checked rows / or also run with doubleclick
Code: Select all
#Warn
setworkingdir,%a_scriptdir%
filename1=Run checked TestFiles
tmrx=%a_scriptdir%\MyTestFiles ;- here are 3 xy.ahk files for test
ifnotexist,%tmrx%
{
filecreatedir,%tmrx%
fileappend,run`,charmap,%tmrx%\charmap-test.ahk
fileappend,runwait`,%comspec% /c ping www.autohotkey.com -n 4,%tmrx%\ping-test.ahk
fileappend,runwait`,%comspec% /k systeminfo,%tmrx%\systeminfo-test.ahk
}
extx=ahk
Gui,2:default
Gui,2:Color,Black, Black
Gui,2:Font, S14 ,Lucida Console
Gui,2:Add,ListView,backgroundBlack cYellow x0 y0 w650 h450 +hscroll altsubmit vA1 gGLV checked, I|Name|FullPath
LV_ModifyCol(1,60),LV_ModifyCol(2,250),LV_ModifyCol(3,0),LV_ModifyCol(1,"integer")
Gui,2:add,button, x10 y470 w180 h27 gSelect_all ,Select_all
Gui,2:add,button, x200 y470 w180 h27 gDeselect_all,Deselect_all
Gui,2:add,button, x450 y470 w120 h27 gStart1,START
Gui,2: Show , x0 y0 w700 h520,%filename1%
gosub,fillx
return
;-----------------------------------------------------
2Guiclose:
exitapp
;-----------------------------------------------------
Select_All:
LV_Modify(0, "Check") ; Select all.
return
;-----------------------------------------------------
Deselect_All:
LV_Modify(0, "-check") ; De-select all.
return
;-----------------------------------------------------
GLV:
Gui,2:ListView, A1
LV_GetText(C1,A_EventInfo,1), LV_GetText(C2,A_EventInfo,2), LV_GetText(C3,A_EventInfo,3)
if (A_GuiEvent = "DoubleClick")
{
aa:="ROW= " . a_eventinfo . "`nC1=" . c1 . "`nC2=" . c2 . "`nC3=" . c3
msgbox,%aa%
try
run,%c3%
}
return
;-------------------------------------
Start1:
LV_Modify(0,"-select")
e:=""
Rowx :=0
Checkedx:=i:=0
while i:=LV_GetNext(i, "Checked")
Checkedx++ ;- total checked
;-- run checked :
While (Rowx := LV_GetNext(Rowx, "checked"))
{
C3=
LV_GetText(C3,Rowx,3)
e .= C3 . "`n"
gosub,runx
C3=
LV_Modify(rowx, "-check")
}
msgbox, 262208, ,ENDED`n%e%,
e=
Return
;-----------------------------------
Runx:
try
runwait,%c3%
return
;---------- Fill-Listview ----------
fillx:
Gui,2:submit,nohide
Gui,2:ListView,A1
I=0
LV_Delete()
Loop, %tmrx%\*.*, 0, 1
{
If A_LoopFileExt in %Extx%
{
I++
O=%A_LoopFileName%
T=%A_LoopFileFullPath%
LV_Add("Check" 0, I, O, T)
}
}
LV_ModifyCol(2, "Sort")
LV_Modify(LV_GetCount(), "Vis") ;scrolls down
return
;--------------------------------------------------
;=============================================================