Dirk Diggler Posted February 22, 2006 Posted February 22, 2006 I found that AutoIt hasn't variable or macros like @Activewindow. So, how i can check if active window title matches some regular expression?
Valuater Posted February 22, 2006 Posted February 22, 2006 Maybe $win = "Untitled -" If WinActive($win) Then MsgBox(0, "", "Window was active") EndIf 8)
Dirk Diggler Posted February 23, 2006 Author Posted February 23, 2006 i explained wrong. it works when u know, what window title u need to check. In case you don't, how you can receive title of active window?
Valuater Posted February 23, 2006 Posted February 23, 2006 (edited) maybe this can help Dim $num, $names $var = WinList() For $i = 1 to $var[0][0] ; Only display visble windows that have a title If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then $num = $num + 1 $names = $names & $var[$i][0] & @CRLF EndIf Next Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc MsgBox(0, "Total Windows = " & $num, "Title's of all task bar Windows" & @CRLF & @CRLF & $names & " ") 8) Edited February 23, 2006 by Valuater
Moderators SmOke_N Posted February 23, 2006 Moderators Posted February 23, 2006 (edited) While he's making a long script, you could try this: MsgBox(0, 'test', WinGetTitle(''))Edit: After reading this again, I don't think I'm following correctly...HotKeySet('{end}', 'testtitle') While 1 Sleep(100000) WEnd Func testtitle() If StringInString(WinGetTitle(''), 'text in title I want') Then MsgBox(0, 'test', WinGetTitle('')) EndFuncThis picks the active windows title, and then matches a string in it, if the statement is true, then the msgbox will appear... Is the right direction, or does Valauter have you on the right path? Edited February 23, 2006 by SmOke_N 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.
Dirk Diggler Posted February 23, 2006 Author Posted February 23, 2006 All is right, WinGetTitle('') is that thing i'm searching for
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