Eggsplorer Posted December 3, 2013 Posted December 3, 2013 Hey =) I have a window which contains the text: "# Drivers, # Software, # Windows Updates". The amount can be 0 or higher 0. I want the window to get closed in case it is 0 for every value. Otherwise I want want my script to continue. Case 1 ( Values = 0) is easy and works fine: If WinWaitActive ("Program", "0 Drivers, 0 Software, 0 Windows Updates", 0) Then WinClose ("DeskUpdate", "") Exit EndIf Case 2 didn't work the way I tried it: $var = <> 0 ;or $var <> 0 If WinWaitActive ("Program", $var $ " Drivers, 0 Software, 0 Windows Updates", 0) Send("{TAB}") Send("{TAB}") Send("{ENTER}") I guess the best way would be to distinguish between Case 1 and "not Case 1" but I don't know how to do that, If my example would work I'd have to have 6 different Cases since the values can be 100, 010, 001, 110, 011, 111. It would suffice though. Thanks in advance =)
Moderators Melba23 Posted December 3, 2013 Moderators Posted December 3, 2013 Eggsplorer,Welcome to the AutoIt forum. You will need to read and examine the text - I do not believe you are going to be able to use the "text" parameter to do it. Try using the AutoIt Window Info tool and see if you can get the required text in the "Visible/Hidden Text" tabs. If so then we can extract it and look at the values before determining what to do next. You find the tool at "...AutoIt3Au3Info.exe". Please post the contents of those tabs - see here how to do it. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Eggsplorer Posted December 3, 2013 Author Posted December 3, 2013 (edited) I lready used the AutoIt Windows Info tool and compared both windows. They are identical except for the values I mentioned. Case 1: My update program found no updates and I want it to get closed: Tab: "Visible Text" [...] Ergebnis Systemüberprüfung: 0 Treiber, 0 Software, 0 Windows Update(s), 0 BIOS Update(s) (Überprüfungszeit: 7 Sekunden) [...] Case 2: My update program found updates and I want my script to continue: Tab: "Visible Text" [...] Ergebnis Systemüberprüfung: 3 Treiber, 0 Software, 9 Windows Update(s), 1 BIOS Update(s) (Überprüfungszeit: 4 Sekunden) [...] The rest of The "Visible Text"-tabs is identical. The tabs "Hidden Text" are completely identical. Edited December 3, 2013 by Eggsplorer
Moderators Melba23 Posted December 3, 2013 Moderators Posted December 3, 2013 Eggsplorer,Excellent news. Now I suggest you use WinGetText to extract that text into a variable and then do this:#include <Array.au3> ; Just for display $sText = "Ergebnis Systemüberprüfung: 0 Treiber, 0 Software, 0 Windows Update(s), 0 BIOS Update(s) (Überprüfungszeit: 7 Sekunden)" $aRet = StringRegExp($sText, "\s(\d+)\s", 3) _ArrayDisplay($aRet) ; Just for display ; You may have to adjust these indices if there are more values than shown in your example If $aRet[1] + $aRet[2] + $aRet[3] = 0 Then ConsoleWrite("All zero" & @CRLF) Else ConsoleWrite("Something" & @CRLF) EndIfDo come back if you run into problems. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Eggsplorer Posted December 5, 2013 Author Posted December 5, 2013 Thanks a lot =) While I was trying your solution I found Visible Text in my window which is different depending on my search result. This made it a lot easier. Greetings Eggsplorer
Moderators Melba23 Posted December 5, 2013 Moderators Posted December 5, 2013 Eggsplorer,Glad I could help. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
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