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.
@emendelson
Could you not use time.apple.com or other time server to do it automatic.
I did some test in UTM change the clock before I start VM MacOS 9.2.1
And the time was updated with this settings. The time before I start the VM
was 1 hour short. As you could see from the picture below if you compare
the real time with the time it made sync. (13:50:40 23-09-25)
@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.
If I’m correct its 2 Panasonic VL2330 type battery with 3 cabels.
You could investigate the old one how to make it your self.
The VL2330 is 3 Volt so thats why you need 2… becouse you need 6 Volt.
The idea is to get the right ampere and voltage.
If you connect the battery in parallel you increase the ampere and voltage is the same.
if you connect the battery in serial you increase the voltage and ampere is the same.
You could use a resistor to lower the ampere if that is needed.
If you have the correct data for the battery any handy electrician could bould it.
I did see something on the github about a patch to make it use any type of battery.