Subz Posted February 16, 2017 Posted February 16, 2017 (edited) Sorry difficult to test, I think your issue is that you need to give ControlCommand a value for example ischecked = 0 or 1, I found that using text had undesired effects, so went back to using Class and Instance, please double check the instances are correct. I didn't know what the second instance for &Aktualisierung der Kalkulationsvorgaben übernehmen was so just used 21, hope that makes sense $hWnd = _WinWaitActivate("Artikel bearbeiten","Serien-/Chargennu&mm") ;~ &Gewinn bei Verkaufspreisänderung aktualisieren If ControlGetText ($hWnd, "", '[CLASS:Button; INSTANCE:14]') = '&Gewinn bei Verkaufspreisänderung aktualisieren' Then If ControlCommand($hWnd, "", "[CLASS:Button; INSTANCE:14]", "IsChecked") = 0 Then ControlCommand($hWnd,"","[CLASS:Button; INSTANCE:14]", "Check") EndIf ElseIf ControlGetText ($hWnd, "", '[CLASS:Button; INSTANCE:22]') = '&Gewinn bei Verkaufspreisänderung aktualisieren' Then If ControlCommand($hWnd, "", "[CLASS:Button; INSTANCE:22]", "IsChecked") = 0 Then ControlCommand($hWnd,"","[CLASS:Button; INSTANCE:22]", "Check") EndIf EndIf ;~ &Aktualisierung der Kalkulationsvorgaben übernehmen If ControlGetText ($hWnd, "", '[CLASS:Button; INSTANCE:21]') = '&Aktualisierung der Kalkulationsvorgaben übernehmen' Then If ControlCommand($hWnd, "", "[CLASS:Button; INSTANCE:21]", "IsChecked") = 1 Then ControlCommand($hWnd,"","[CLASS:Button; INSTANCE:21]", "UnCheck") EndIf EndIf Edited February 16, 2017 by Subz Grammar
AmicusLinguae Posted February 16, 2017 Author Posted February 16, 2017 Thank you @Subz Your modified code worked, so I made it with the following code. ConsoleWrite(@error & @CRLF) #include <Au3Recorder_Functions.au3> ;Serien-/Chargennu&mm ;Serien-/Chargennu&mm $hWnd = _WinWaitActivate("Artikel bearbeiten","Serien-/Chargennu&mm") ;~ &Gewinn bei Verkaufspreisänderung aktualisieren If ControlGetText ($hWnd, "", '[CLASS:Button; INSTANCE:14]') = '&Gewinn bei Verkaufspreisänderung aktualisieren' Then If ControlCommand($hWnd, "", "[CLASS:Button; INSTANCE:14]", "IsChecked") = 0 Then ControlCommand($hWnd,"","[CLASS:Button; INSTANCE:14]", "Check") EndIf ElseIf ControlGetText ($hWnd, "", '[CLASS:Button; INSTANCE:22]') = '&Gewinn bei Verkaufspreisänderung aktualisieren' Then If ControlCommand($hWnd, "", "[CLASS:Button; INSTANCE:22]", "IsChecked") = 0 Then ControlCommand($hWnd,"","[CLASS:Button; INSTANCE:22]", "Check") EndIf EndIf ;~ &Aktualisierung der Kalkulationsvorgaben übernehmen If ControlGetText ($hWnd, "", '[CLASS:Button; INSTANCE:13]') = '&Aktualisierung der Kalkulationsvorgaben übernehmen' Then If ControlCommand($hWnd, "", "[CLASS:Button; INSTANCE:13]", "IsChecked") = 1 Then ControlCommand($hWnd,"","[CLASS:Button; INSTANCE:13]", "UnCheck") EndIf ElseIf ControlGetText ($hWnd, "", '[CLASS:Button; INSTANCE:21]') = '&Aktualisierung der Kalkulationsvorgaben übernehmen' Then If ControlCommand($hWnd, "", "[CLASS:Button; INSTANCE:21]", "IsChecked") = 1 Then ControlCommand($hWnd,"","[CLASS:Button; INSTANCE:21]", "UnCheck") EndIf EndIf Subz 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now