Sorry for making a so basic question, but I'm new to Python.
Suppose I want some code to run when the cursor is in X position. Or when the active window is Y.
w = win32gui
text = w.GetWindowText(w.GetForegroundWindow())
So if I want something to happen when the text is 'Documents' I'd do this with while & time.sleep loops but that doesn't seem so elegant.
I mean, what is the point of this if I decided I'd like this script to run in the background for the rest of my life? I know it wouldn't interfere with any other process, but if it was the case of a bit more complex tracking?
Isn't it possible just to make something happen when a variable turns X?