SSJoco Posted October 3, 2008 Share Posted October 3, 2008 I need a text from a statusbar, however Autoit can't see any text in the bar. (nor gettext, neither statusbargettext) Window Info show this text in the Visible text, but I don't know how I can use it. Any Idea? Link to comment Share on other sites More sharing options...
komalo Posted October 3, 2008 Share Posted October 3, 2008 in what program the status bar ? [font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font] Link to comment Share on other sites More sharing options...
SSJoco Posted October 3, 2008 Author Share Posted October 3, 2008 HP ServiceDesk Search Windows. The results is in the Statusbar ex. 741 Item(s) I need that number. Link to comment Share on other sites More sharing options...
Zedna Posted October 3, 2008 Share Posted October 3, 2008 Use WinGetText() and parse given string by StringRegExp() to get your number from it. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
SSJoco Posted October 3, 2008 Author Share Posted October 3, 2008 Use WinGetText() and parse given string by StringRegExp() to get your number from it.Thnx, but How can I parse it?The text:x Item(s) (x 1-3 digits) Link to comment Share on other sites More sharing options...
Zedna Posted October 3, 2008 Share Posted October 3, 2008 $s = "1 Item(s)"ConsoleWrite(GetNumber($s) & @CRLF) $s = "12 Item(s)" ConsoleWrite(GetNumber($s) & @CRLF) $s = "123 Item(s)" ConsoleWrite(GetNumber($s) & @CRLF) Func GetNumber($string) $string = StringSplit($string, ' Item(s)', 1) Return $string[1] EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
SSJoco Posted October 3, 2008 Author Share Posted October 3, 2008 $s = "1 Item(s)"ConsoleWrite(GetNumber($s) & @CRLF) $s = "12 Item(s)" ConsoleWrite(GetNumber($s) & @CRLF) $s = "123 Item(s)" ConsoleWrite(GetNumber($s) & @CRLF) Func GetNumber($string) $string = StringSplit($string, ' Item(s)', 1) Return $string[1] EndFunc It's not working. I have more line inthe input: Look for Configuration Item ... xxx Item(s) I tried this, but It's not working every time (If there is other 'Item' lines) $text = WinGetText("Advanced Find", "") $t=StringRegexp($text, "\d*? Item", 3) $tt=StringSplit($t[0], " ") $number = $tt[1] Link to comment Share on other sites More sharing options...
SSJoco Posted October 3, 2008 Author Share Posted October 3, 2008 $s = "1 Item(s)"ConsoleWrite(GetNumber($s) & @CRLF) $s = "12 Item(s)" ConsoleWrite(GetNumber($s) & @CRLF) $s = "123 Item(s)" ConsoleWrite(GetNumber($s) & @CRLF) Func GetNumber($string) $string = StringSplit($string, ' Item(s)', 1) Return $string[1] EndFunc It's not working. I have more line inthe input: Look for Configuration Item ... xxx Item(s) I tried this, but It's not working every time (If there is other 'Item' lines) $text = WinGetText("Advanced Find", "") $t=StringRegexp($text, "\d*? Item", 3) $tt=StringSplit($t[0], " ") $number = $tt[1] Link to comment Share on other sites More sharing options...
Zedna Posted October 3, 2008 Share Posted October 3, 2008 Post full example of your window content. My given example was made for content you provided! Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
SSJoco Posted October 3, 2008 Author Share Posted October 3, 2008 Post full example of your window content.My given example was made for content you provided!I search in a program and this is the result page. I need the number of Items. I can get this text only with WinGetText() command which has the following result:Look forConfiguration ItemConfiguration ItemAdvanced SearchFindSearchOKCancel174 Item(s)How can I extract only the 174 Item(s) line? Link to comment Share on other sites More sharing options...
Zedna Posted October 3, 2008 Share Posted October 3, 2008 Try something like this: #Include <String.au3> $s = ... ConsoleWrite($s & @CRLF) ConsoleWrite(_StringBetween($s, '\r\n', " Item(s)", -1, 1) & @CRLF) Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 3, 2008 Moderators Share Posted October 3, 2008 Try something like this: #Include <String.au3> $s = ... ConsoleWrite($s & @CRLF) ConsoleWrite(_StringBetween($s, '\r\n', " Item(s)", -1, 1) & @CRLF)_StringBetween() returns an array. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
SSJoco Posted October 6, 2008 Author Share Posted October 6, 2008 I have found the solution: $text = WinGetText("Advanced Find", "") $t=StringRegexp($text, "\d*?" & " Item...", 3) $tt=StringSplit($t[0], " ") $tt[1] contain the number Link to comment Share on other sites More sharing options...
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