Playing with the System Date

Ok, I have found out how to chage the Current Date of my System using a Script. Now I need a Script to set the Date back to today and now. My guess is that I will need to simply enable the “Set Date & Time autimatically” in ‘Date and Time’ in the System Preferences.

Could someone please tell me how to do this.

Thanx!

I’m sure somebody will know the answer. I don’t, but you can start by looking at the AS dictionary for “System Preferences” and you’ll be able to open pane “com.apple.preference.datetime”. Then you can use UI scripting. Better yet, man defaults in terminal to get at the settings from the command line. Or you could find a X-method that returns the current time, do an XML-RPC to it, and set the datetime back yourself the same way you’re setting it now. If you’re just re-setting the date for a little while, save the origional date as a property in your script and then run the script again to flip it back.