Standalone SheepShaver for OS X (add ROM and OS 8.5-9.0.4)

About unsupported SheepShaver configurations, like COI (Chubby Bunny), SheepShaver Wrapper, etc.

Moderators: Cat_7, Ronald P. Regensburg

emendelson
Forum All-Star
Posts: 1293
Joined: Tue Oct 14, 2008 12:12 am

Re: Standalone SheepShaver for OS X (add ROM and OS 8.5-9.0.4)

Post by emendelson »

adespoton wrote: Tue Jun 22, 2021 9:57 pm [ like AppleScript's ability to be relatively easily debugged. That can't be sed for awk :D
Ouch!
User avatar
mabam
Master Emulator
Posts: 364
Joined: Wed Apr 10, 2013 9:32 am

Re: Standalone SheepShaver for OS X (add ROM and OS 8.5-9.0.4)

Post by mabam »

Debugging sed is awkward.
emendelson
Forum All-Star
Posts: 1293
Joined: Tue Oct 14, 2008 12:12 am

Re: Standalone SheepShaver for OS X (add ROM and OS 8.5-9.0.4)

Post by emendelson »

The connection here turns out to be fast enough. I've notarized and uploaded revised versions of the Mac OS 9 app and the System761 app. Thanks again for everyone's help.
User avatar
mabam
Master Emulator
Posts: 364
Joined: Wed Apr 10, 2013 9:32 am

Re: Standalone SheepShaver for OS X (add ROM and OS 8.5-9.0.4)

Post by mabam »

This is even shorter:

Code: Select all

on getResolutions()
	
	set resolutions to {}
	repeat with p in paragraphs of ¬
		(do shell script "system_profiler SPDisplaysDataType | grep Resolution:")
		try
			set {tid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {" X ", " x "}}
			copy {word -1 of text item 1 of p as number, word 1 of text item 2 of p as number} to end of resolutions
			set AppleScript's text item delimiters to tid
		on error
			copy {1440, 900} to end of resolutions
		end try
	end repeat
	# `resolutions` now contains a list of size lists;
	# e.g., with 2 displays, something like {{2560, 1440}, {1920, 1200}}
	return resolutions
	
end getResolutions
By referring to the items as “word”, braces and space are seen as delimiter automatically and don’t have to be set in a separate step.

No need to revise your apps again, though. I just wanted to post this for completeness. If at some point you update your apps anyway, you may or may not use this simplified script snippet.
emendelson
Forum All-Star
Posts: 1293
Joined: Tue Oct 14, 2008 12:12 am

Re: Standalone SheepShaver for OS X (add ROM and OS 8.5-9.0.4)

Post by emendelson »

I'll add that to the code for the next update. Since my own AppleScript is totally amateurish and redundant and spaghetti-like, it's good to have some parts of it that work efficiently. Thank you!
Post Reply