Programmatically Change Screen Saver "Start after" time

I would like to change the time before my screen saver starts based on WiFi network. I am running Yosemite (10.10.1). I will use Keyboard Maestro to trigger the action.

I need to find the correct setting or possibly Applescript Library / Dictionary and I can take it from there.This is related to, but not quite the same as askForPasswordDelay. That setting determines how long, after the screen saver starts, before a password is required to entered. I want to change the delay before the screen saver comes on.

I've done a lot of searching and found nothing yet, any help would be greatly appreciated.


I was able to find the following:

$defaults -currentHost write com.apple.screensaver idleTime n

Where n is number of seconds before screensaver starts (0 = never)

This is exactly what I was looking for. reference: http://hints.macworld.com/article.php?story=20080207030932483


Obviously the other answer works but there is an AppleScript method as well.

tell application "System Events" to tell screen saver preferences to set delay interval to 0