AWorker Posted August 23, 2020 Share Posted August 23, 2020 So I tried to make a script to check if active window title changed but it doesnt work. Here is a test example that shows in tooltip both title from current active window and if title has changed (it checks it in If statement). What did I do wrong? $tooltip="" While 1 if Not $tooltip=WinGetTitle("[active]") Then ToolTip("different" & " " & WinGetTitle("[active]"), 0, 0) Sleep(500) Else ToolTip("equal" & " " & WinGetTitle("[active]"), 0, 0) EndIf $tooltip=WinGetTitle("[active]") WEnd Link to comment Share on other sites More sharing options...
Nine Posted August 23, 2020 Share Posted August 23, 2020 (edited) Your usage of Not is wrong, you should use : If $tooltip <> WinGetTitle("[active]") Then or (but not so good programming) : If Not ($tooltip = WinGetTitle("[active]")) Then See help file for operators precedence here. Edited August 23, 2020 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
AWorker Posted August 23, 2020 Author Share Posted August 23, 2020 Yes thanks I realized that myself. Didn't know that <> exists and forgot about precedencies (( Its all working now. 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