Page 1 of 1

A script to quit Sheepshaver ...

Posted: Thu Mar 19, 2015 11:35 pm
by rlesperance
Hi,

I use SheepShaver with «Simply Accounting», an OS 9 accounting app. When I forget to quit the app it prevents my Imac to go to sleep. Does somebody have a little script that could quit the app then SheepShaver in order to enable my to go to sleep ?

Thanks in advance.



Robert Lespérance

Re: A script to quit Sheepshaver ...

Posted: Mon Mar 23, 2015 5:15 pm
by adespoton
An alternative solution should be to write an external OS X script to suspend SheepShaver. That way, re-opening SS will bring everything right back up :)

http://osxdaily.com/2013/05/30/pause-re ... -mac-os-x/

Related:
https://discussions.apple.com/thread/41 ... 0&tstart=0

Actually, this is making me think that a LaunchService that looks for minimized or hidden apps and auto-suspends them would be neat :) You'd have to ensure that you actually wanted any minimized or hidden app to be suspended, but it could be a really simple solution to use once set up.

Re: A script to quit Sheepshaver ...

Posted: Mon Mar 23, 2015 7:58 pm
by Ronald P. Regensburg
If I set Energy Saver control panel in OS9 and set Energy Saver preferences in OSX for a longer delay before sleep. My iMac will go to sleep with SheepShaver running.

("Allow Emulated CPU to Idle" is checked in SheepShaver preferences. Not sure if that is needed for this to work.)

Re: A script to quit Sheepshaver ...

Posted: Tue Mar 24, 2015 5:49 pm
by rlesperance
Hi adespoton ... I do a little bit of scripting, but almost only by copying instructions and playing around until the job gets done. That being said, it does not have to be very complicated for me to be in pain with scripting. I do my best ... but since practicing and time are the scripter's best friend, I am out of luck, time is seriously missing. It will very difficult to become an expert. I have to relearn back again everytime. But ... I will try more soon.

Hi Ronald ... I don't have the OS 9 Energy Saver control panel. Do you an idea where I can find it ?

Re: A script to quit Sheepshaver ...

Posted: Tue Mar 24, 2015 6:27 pm
by Ronald P. Regensburg
rlesperance wrote:I don't have the OS 9 Energy Saver control panel. Do you an idea where I can find it ?
It is part of a normal OS9 system installation and it should be with the other control panels. Is it not in your OS9 installation? Odd. Did you do the system installation yourself? Do you use an English or a French OS9? In OSX the preferences pane is called "Économiseur d'énergie" in French. Doesn't the control panel have the same name in MacOS9?

Re: A script to quit Sheepshaver ...

Posted: Tue Mar 24, 2015 6:30 pm
by rlesperance
My OS 9 is in English and there is no such control panel. I don't recall exactly where the OS came from ... probably from the web somewhere.

Re: A script to quit Sheepshaver ...

Posted: Tue Mar 24, 2015 6:56 pm
by adespoton
Do you have the install CD? This should have the control panel on it. If you just have the "live" Redundant Robot OS 9 image, that would have this sort of thing stripped out.

Re: A script to quit Sheepshaver ...

Posted: Tue Mar 24, 2015 6:57 pm
by rlesperance
I don't have the original install CD.

Re: A script to quit Sheepshaver ...

Posted: Tue Mar 24, 2015 7:46 pm
by Ronald P. Regensburg
adespoton wrote:If you just have the "live" Redundant Robot OS 9 image, that would have this sort of thing stripped out.
The Redundant Robot "OS9.img" contains the Energy Saver control panel. But the system volume inside COI "Chubby Bunny" does not.

Re: A script to quit Sheepshaver ...

Posted: Tue Mar 24, 2015 8:06 pm
by rlesperance
As Ronald reminded me, my OS 9 probably comes from COI, my first SS install. Thanks ... I now have the control panel.
Ronald said: If I set Energy Saver control panel in OS9 and set Energy Saver preferences in OSX for a longer delay before sleep. My iMac will go to sleep with SheepShaver running.
My iMac is set to sleep after 10 minutes and SheepShaver cannot be set for less than 30 minutes. What is it that I have to do exactly ?

Re: A script to quit Sheepshaver ...

Posted: Tue Mar 24, 2015 8:32 pm
by Ronald P. Regensburg
Set your iMac to sleep after more than 30 minutes. I tested it with setting it to 40 minutes.

Re: A script to quit Sheepshaver ...

Posted: Tue Mar 24, 2015 10:22 pm
by adespoton
You can also modify the prefs file to set it to less than 30 min. I remember doing this back in the day, but can't recall the details. It likely involves adjusting a ticks-since-epoch value in a binary file, so it's not for the faint of heart -- but it's doable.

Re: A script to quit Sheepshaver ...

Posted: Wed Mar 25, 2015 12:51 pm
by Ronald P. Regensburg
I had a look at the Energy Saver preferences file. It has no data fork, only a resource fork. Opened it it ResEdit. Three resources of which one contains a description of the file in plain text. The content of the other two resources do not contain easily recognizable text or numbers that can be related to the settings in the control panel.

Re: A script to quit Sheepshaver ...

Posted: Wed Mar 25, 2015 6:37 pm
by adespoton
Yup; that's what I remember. Somewhere in one of those resources is a tick count. You can figure out where by setting the time to 30 min, copying the prefs file, then setting to 60 min and re-copying the prefs file. Open both copies up in ResEdit, and you'll find the bit with the time :)

ResCompare makes this process a bit easier than ResEdit, and also allows you to create a patch file that others can use.

Re: A script to quit Sheepshaver ...

Posted: Fri Jul 24, 2020 8:58 pm
by jrethorst
Ronald P. Regensburg wrote:Set your iMac to sleep after more than 30 minutes. I tested it with setting it to 40 minutes.
I set the OS9 Energy Saver panel to sleep in 30 minutes, and OSX to sleep in 45 minutes. With Sheepshaver running, the Mac did not sleep.