I have an ancient Pismo PowerBook that I sometimes use for testing on real hardware. The pram battery died many years ago, and it’s impractical to replace it, so Mac OS tells me every time I start up that the date is set to 1904. Is there a way to write an AppleScript that will set the current date and time (same as using the Date & Time Control Panel) so that I put that script in the Startup items, and have Mac OS set the date to something recent, like January 1, 2023? That will be better than 1904, anyway.
I’ve experimented with “set current date to” but I can’t make it work, and I can’t find anything in my AppleScript references. The books tell me how to use the current date, but not (as far as I can see) how to set it.
Assuming it’s even possible, you’d probably have to script whatever the app that contains the control panel is (I’ve forgotten). Check and see if there is a dictionary for whatever it’s called.
QuicKeys - a macro utility - could do all kind of wonders on “classic” Mac OS. I’m not sure if it can do more than you can do with AppleScript for your particular goal but maybe worth trying (if you can find an appropriate version).
@leo_r - I actually bought QuicKeys long ago. Will probably try that, though I hope that a startup AppleScript might do the job using GUI Scripting.
@Piyomaru - Thank you for confirming what I guessed might be true. You can change the date/time by hand from the Control Panel, but Apple doesn’t give you a straightforward way to change it by scripting.
@Fredrik71 - Thank you for this. I would certainly use time.apple.com if my Pismo had internet access when it starts up, but my wifi network uses a modern security protocol that isn’t supported on this old system. This works perfectly in a VM, but not on real hardware.
I could probably plug in an ethernet cable when I start it up, but that would mean I could only start it up in a place where I had ethernet available, so I’m hoping for something that would at least give a recent date.
@Fredrik71 - It’s impractical because it’s impossible to find one. No one makes them. The very few offered online by shady-looking sellers are probably twenty years old and long dead. I’ve been searching for a very long time. There’s one seller who MAY make new ones, but he isn’t making them now.
I probably should have said it’s impossible to replace it; apologies for time-wasting.