Is there a way to trigger an action when the Mac OS X screensaver activates or when it goes to sleep (preferably using cocoa)?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can register for various distributed notifications—on 10.6, I’m seeing com.apple.screenIsLocked/screenIsUnlocked and com.apple.screensaver.didstart/willstop/didstop. (Older versions of Mac OS X may not have all of these notifications.) You can observe the notifications as they occur with Notification Watcher.
Also see this answer.