A few years ago I tried to integrate SheepShaver with Mac OS X (now macOS 13+). The idea was to have SheepShaver act more like the Classic environment where you could open up OS 9 applications from the macOS 10+ Finder. I recently dug up my old attempt at this from 6 years ago and updated it extensivly until I got something that roughly works, so I thought I would post how I got this to work in case anyone else was interested in it. This uses a combination of scripts in both macOS 10+ and OS 9 that talk to each other.
In macOS 10+, I set up a script created in Automator as a Quick Action that can be accessed via right clicking an application or file in the macOS 10+ Finder. This script saves a text file with the path to the application/file and then opens Sheepshaver where an Applescript with an alias placed in the OS 9 System folder Startup Items reads the file with the path and opens the application/file in OS 9.
Setup
First you need a working Sheepshaver virtual machine. I personally use SheepShaver Wrapper (http://www.columbia.edu/~em36/sheepshaverwrapper.html) with SheepShaver Version 2.5, 22 December 2022 in macOS Ventura 13.1. I have Mac OS 9.0.4 installed. I think most other SheepShaver setups will work, but don’t quote me on it. You will need to point your Unix root to your home directory.
In your home directory, the scripts will create and use a file called os9_app_path.txt. You can modify the name of this file or where it is located but you will need to update the scripts below to reflect these changes, and it is not recommended unless you know what you are doing.
Create the Quick Action in macOS 10+
In macOS 10+ open /Applications/Automator
File New -> Quick Action
Set “Workflow receives current” to “files or folders” in “Finder”
Select Actions and type “Run Shell Script” into the field next to it
Drag “Run Shell Script” from the left side of the screen to the right side where it says “Drag actions or files here to build your workflow” (or double click Run Shell Script)
Set shell to "/bin/bash"
Set Pass Input to "as arguments"
Copy the following into the script:
Code: Select all
for f in "$@"
do
printf "Unix:${f#*/*/*/}" | sed -r 's/[/]+/:/g' > $HOME/os9_app_path.txt #Save path to classic file
iconv -f UTF-8 -t MACINTOSH $HOME/os9_app_path.txt > $HOME/os9_app_path_tmp.txt #Convert to text encoding for classic mac OS
mv $HOME/os9_app_path_tmp.txt $HOME/os9_app_path.txt
done
Save the Quick Action. I named it “open_in_os9” but you can name it whatever you want.
You might need to give permission to the quick action
System Settings -> Privacy & Security -> Extensions -> Finder
Click the checkbox next to the Quick Action your just created
Set up script in SheepShaver
Open SheepShaver
Create the following script using Applescript
The script editor is found (at least for me) under:
/Macintosh HD/Applications/Apple Extras/AppleScript/Script Editor
Copy the following into the script editor:
Code: Select all
on idle
set app_path_file to "Unix:os9_app_path.txt"
set open_this_app to read file app_path_file
if text 1 thru 10 in open_this_app is not "***DONE***" then --Check if already opened app
tell application "Finder"
open file open_this_app
end tell
write "***DONE***" to file app_path_file --App has now been open so write ***DONE*** into app_path_file
end if
return 1 --wait 1 seccond before checking again
end idle
Save the script as a “classic applet” anywhere easily accessible. Make sure "Stay Open" and "Never Show Startup Screen" are both checked.
Make an alias of the script and place the alias in
/Macintosh HD/System Folder/Startup Items
How to use it
In the macOS 10+ Finder, right click an application or file you want to open in SheepShaver.
Scroll down to Quick Actions
You should see your Quick Action. Select it to open the file in SheepShaver.
You can leave SheepShaver running in the background and this will still work. You can also open multiple applications in this manner.
Some caveats
Quitting the opened classic application still leaves SheepShaver running. I tried adding shut down to the script inside of SheepShaver but it only worked some of the time, and caused other issues with some applications opening and then SheepShaver immediately shutting down. I found it easier to just manually shut down SheepShaver when finished.
The applescript running in SheepShaver will keep running. This will let you keep opening classic mac applications from macOS 10+ while SheepShaver is running. I might want to try figuring out a way to hide the running script, but otherwise it is not much of a problem. It probably adds a small amount of CPU usage but I doubt much.
I couldn’t figure out a way to directly double click classic applications in macOS 10+ to open them in SheepShaver. With these scripts, you still have to right click the file you are trying to open go to Quick Actions.