A script to quit Sheepshaver ...

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Post Reply
rlesperance
Granny Smith
Posts: 141
Joined: Thu Mar 17, 2011 1:46 am

A script to quit Sheepshaver ...

Post 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
User avatar
adespoton
Forum All-Star
Posts: 3068
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: A script to quit Sheepshaver ...

Post 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.
User avatar
Ronald P. Regensburg
Expert User
Posts: 6323
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: A script to quit Sheepshaver ...

Post 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.)
rlesperance
Granny Smith
Posts: 141
Joined: Thu Mar 17, 2011 1:46 am

Re: A script to quit Sheepshaver ...

Post 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 ?
User avatar
Ronald P. Regensburg
Expert User
Posts: 6323
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: A script to quit Sheepshaver ...

Post 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?
rlesperance
Granny Smith
Posts: 141
Joined: Thu Mar 17, 2011 1:46 am

Re: A script to quit Sheepshaver ...

Post 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.
User avatar
adespoton
Forum All-Star
Posts: 3068
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: A script to quit Sheepshaver ...

Post 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.
rlesperance
Granny Smith
Posts: 141
Joined: Thu Mar 17, 2011 1:46 am

Re: A script to quit Sheepshaver ...

Post by rlesperance »

I don't have the original install CD.
User avatar
Ronald P. Regensburg
Expert User
Posts: 6323
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: A script to quit Sheepshaver ...

Post 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.
rlesperance
Granny Smith
Posts: 141
Joined: Thu Mar 17, 2011 1:46 am

Re: A script to quit Sheepshaver ...

Post 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 ?
User avatar
Ronald P. Regensburg
Expert User
Posts: 6323
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: A script to quit Sheepshaver ...

Post by Ronald P. Regensburg »

Set your iMac to sleep after more than 30 minutes. I tested it with setting it to 40 minutes.
User avatar
adespoton
Forum All-Star
Posts: 3068
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: A script to quit Sheepshaver ...

Post 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.
User avatar
Ronald P. Regensburg
Expert User
Posts: 6323
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: A script to quit Sheepshaver ...

Post 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.
User avatar
adespoton
Forum All-Star
Posts: 3068
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: A script to quit Sheepshaver ...

Post 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.
jrethorst
Tinkerer
Posts: 67
Joined: Sun Nov 05, 2006 1:21 am

Re: A script to quit Sheepshaver ...

Post 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.
Post Reply