Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I had a script that I used to use to activate my screen saver, and it no longer works in Mountain Lion.

It was a shell script that called an AppleScript script:

osascript /Users/lorin/scripts/lockscreen.scpt

This is what the lockscreen.scpt file looks like:

tell application "ScreenSaverEngine" 
end tell

If I bring up lockscreen.scpt in the AppleScript Editor, I get the "Choose Application" dialog popping up asking "Where is ScreenSaverEngine?"

Anybody know the Mountain Lion-y way to activate the screen saver?

share|improve this question
up vote 6 down vote accepted

This works in ML:

tell application "System Events"
    set ss to screen saver "Random"
    start ss
end tell

"Random" can be replaced with your choice, "Flurry" or "Shell" and so on.

Source Disclosure:

share|improve this answer
How do I make it stop the screen saver? I tried tell application "System Events" to stop screen saver – Jayen Aug 22 '12 at 0:55
@Jayen tell application "System Events" to quit current screen saver – wrtsprt Aug 22 '13 at 9:32

That is a nice way of starting a random screen saver. If, however, you'd simply like to start the active screen saver, you can use this in Mountain Lion:

tell application "System Events" 
    start current screen saver
end tell
share|improve this answer

To shut down your computer you can try to type in this code:

   tell application "Finder"
shut down
end tell
share|improve this answer
That does not call the screen saver it does something totally different – Mark May 17 '14 at 17:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.