Reputation: 45
I am trying to make an App to lock my OS X mavericks when I have worked for 45 mins. And 5 min after it is locked, I want it is unlocked automatically. this App will force me to have a rest periodically.
I have searched the google and stack overflow, it seems that there are two ways to do this. one is by Mac make authorization plug-in or by a screen saver something like that.
But I don't know both of them very much.
Could you tell me please, where should I start?
By the way, I am a good IOS developer but have little experiences on mac app development.
Thank you very much!!! ORZ!
Upvotes: 2
Views: 2742
Reputation: 27611
Using an authorization plugin is quite involved, but possible. I would recommend simply launching the screensaver. If the screen saver is set to lock when launched, this will fulfill your requirement of forcing the lock
Note that the screen saver is just an application located at this path:-
/System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app
To launch every 45 minutes, follow Apple's guide to Scheduling Timed Jobs with launchd.
If you really want to have it unlocked after a period of time, then you'll have to research the Authorization Plugin; the API can be found here.
Upvotes: 4