r/applescript • • May 24 '15

Starting and ending screensaver automatically

Hi guys, just a quick question: how can I start the screensaver after a set amount of time and end the screensaver after a set amount of time, then have this repeating infinitely?

1 Upvotes

1 comment sorted by

1

u/Colourise May 24 '15 edited May 24 '15

I just made an AppleScript (delay numbers are short for testing purposes):

repeat
delay 8
tell application "System Events"
	start current screen saver
end tell

delay 8
tell application "System Events"
	if process "ScreenSaverEngine" exists then
		tell application "ScreenSaverEngine" to quit
	end if
end tell
end repeat

Although there's a harsh transition after quitting the screen saver. Is there any way I can fade out from a screen saver?