Change Date With Applescript?

Hi, i’ve been looking all over the internet to see if this is possible, to start with, i don’t really know anything about AppleScript, the only coding i ever learnt was ActionScript 3 for Flash.

I just want to know if it’s possible to change the date on your computer using AppleScript???

On Windows there is a program called ‘RunAsDate’ where you can run a program at a set date, well that’s what i want to do with Applescript. Using Automator I was going to run the script and then make it open the program rather than me having to change the date everytime i open it.

So all in all, i just want to know if it’s possible to set the date on your Mac with AppleScript?

(i did play around with different combination’s, and besides getting lots of error, in the end i got a message saying ‘Access Not Allowed’, are you just not able to do this?)

Any help is greatly appreciated.

Jesse

Hi,

it’s possible with /usr/sbin/systemsetup (10.5. and higher) with the -settime and -setdate flags, but what’s the purpose?

If you want to extend the trial period of a software, buy it :wink:

I thought people might think that when i asked, but no that’s not the reason, the program i want it for had an update automatically on the 1st of April, and i’ve heard reports that it’s a bad update with lots of bugs, so i want to make the program think it hasn’t became the first of April yet, and i don’t want to keep changin the date incase i forget one time and stuff the program. Hence why i wanna make it run automatically.

My internet is far too slow to download any programs lol.

so how would i go about setting the date so it changes to 1.3.2010?

the -setdate switch requires disabling networktime


do shell script "/usr/sbin/systemsetup -setusingnetworktime off -setdate '03:01:10'"