Is it possible to lock the screen in OS Yosemite using code? And then put in a scheduler to run every two minutes?
If so what script language are we talking, task scheduler program etc
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.
Sign up to join this communityIs it possible to lock the screen in OS Yosemite using code? And then put in a scheduler to run every two minutes?
If so what script language are we talking, task scheduler program etc
Here is the way I would try completing this task:
sudo nano ~/sleep.sh
#!/bin/bash sleep 120 pmset sleepnow #osascript -e 'tell application "System Events" to sleep'
Note: The last line with the # at the front is a substitute of the one above (pmset sleepnow)
env EDITOR=nano crontab -e
* * * * * sh ~/sleep.sh
sudo touch /private/etc/crontab
P.S. I haven't tested it, but I will gladly help if anything additional is needed.