A script I have switches specific folders in a program on/off, but only one a time with radio buttons. I want to use checkboxes instead so I can a switch on/off all folders with the same script.
If I click the first checkbox, the code executes. With the other two checkboxes it doesn't. It doesn't loop either.
I'm trying to get a part of the script to repeat for each checkbox clicked (Loop).
If the first checkbox is clicked, in the loop the down key should be pressed x times.
What am I missing here?
Thanks!
Code:
SetTitleMatchMode 2
CoordMode, Mouse, Relative
Gui, Add, Checkbox, x36 y7 w90 h30 vCheckbox, &Deutsch
Gui, Add, Checkbox, xp yp+30 wp hp , &English
Gui, Add, Checkbox, xp yp+30 wp hp , &Français
Gui, Add, Button, xp y127 w70 h30 Default gOK, &OK
Gui, Add, Button, xp+80 yp wp hp gCancel, &Abbrechen
Gui, Show, w330 h185, Sprache in PhraseExpress aktivieren
Return
Cancel:
GuiEscape:
GuiClose:
ExitApp
OK:
Gui, Submit, NoHide
ToolTip, Du hast Radiobutton %Checkbox% gedrückt!
Sleep, 400
ToolTip
Send ^!p
WinWaitActive ahk_class TpexMWnd4
Sleep 1500
click 100, 100
Sleep 500
Send {home} ; geht zum obersten Ordner / Select top folder
Sleep 200
Send ^+{left} ; collapse all folders
Sleep 500
send {down 2} ; move to "Texte"
Sleep 400
Send {right} ; Ordner "Texte" erweitern / expand folder "texte"
Sleep 400
send {down}{right} ; Ordner "Sprachen" erweitern / expand folder "sprachen"
sleep 400
Loop, %checkbox%
{
Send {down %Checkbox%} ; Deutsch, English, Français
sleep 400
Send +{f10} ; Menutaste / Menu key
Sleep 400
send {Down 8} ; Aktiv wählen / Choose state "active"
Sleep 400
send {Enter} ; bestätigen / confirm
Sleep 1000 ; 1 Sek. wartezeit mindestens, weil das Ändern des Zustands von aktiv zu inaktiv lange dauern kann
send {left}
Sleep 500
}
Send !{F4} ; pex schliessen / close PhraseExpress
Return