Quitting SheepShaver by script ...

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
Mac Mechanic
Posts: 172
Joined: Thu Mar 17, 2011 1:46 am

Quitting SheepShaver by script ...

Post by rlesperance »

Hi,

Can somebody help me with this one ? I want to create an AppleScript that quits SheepShaver when left unatended or inactive for a specific time.

I just tried the basic script to quit SheepShaver and got no success. Here is my script:

Code: Select all

tell application "System Events" to exists process "SheepShaver"
if result is true then
	quit application "SheepShaver"
end if
Running this script does work for other apps. Do you have any idea why it does not work with SheepShaver ?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7831
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Quitting SheepShaver by script ...

Post by Ronald P. Regensburg »

The script does work, but when you try to quit SheepShaver the MacOS asks to shut down the emulated machine. If you would quit SheepShaver without shutting down the emulated machine first, it would be like a hard shutdown that could result in file system corruption on the MacOS volumes.

You could use a script like this one below. It brings SheepShaver to the front, quits SheepShaver, and (after a delay to allow for the dialog to appear) presses Return to shut down the emulated machine. If a delay of one second is not long enough on your machine, you can make it two seconds.

Code: Select all

tell application "System Events" to exists process "SheepShaver"
if result is true then
	activate application "SheepShaver"
	quit application "SheepShaver"
	delay 1
	tell application "System Events" to key code 36 #return
end if
rlesperance
Mac Mechanic
Posts: 172
Joined: Thu Mar 17, 2011 1:46 am

Re: Quitting SheepShaver by script ...

Post by rlesperance »

Like I have already said a few times ... Ronald, you are a genius. It works perfectly. I will include that in a background routine, and it should do the trick. Leaving SS running prevents my screen saver to launch and the monitor always stays bright.
Post Reply