Is there a way to determine what state the Mac's screen is in? I'd like to have a script that checks if the screen is in a non-active state; so either the screen saver is running or the display is asleep. Can this even be done via applescript?
I'm trying to make a script similar to these proximity detection scripts, except I want them to activate when I've either manually activated the screensaver, put the display to sleep or when the system activates the time based screensaver and display sleep settings.