Mac OS 9 Lives
Mac OS 9 Discussion => Mac OS 9, Hacks & Upgrades => Topic started by: n8blz on April 04, 2026, 09:54:56 PM
-
Good evening gentlemen
My kids and I do a lot of retrogaming on my old Macs. One of the constant annoyances of doing so on OS9 is the CD images and the way they accumulate and clutter up the desktop unless you eject them all. It’s such a simple, automate-able process: mount this image, open this application, when this application quits unmount this disk.
I have come across pre compiled Applescripts for OSX games that do this, but never the script source. The new and excellent software Gamebox also does this for you, so it’s clearly possible. I am wondering if anyone has an Applescript source or other helper application that can do this? I intend to share the results of this thread, if there are any, on the ‘Garden with clear instructions on how to set it up for a given game.
Thank you for your suggestions!
-
Credit to MikeTomTom at the ‘Garden for writing most of the script.
Here is the applescript:
>property idlePeriod : 0.5
>
>tell application “Finder”
> activate
> open file “ISO-FILENAME” of folder “ISO-LOCATION-PATH” of disk “ISO-LOCATION-DISK”
> delay 2
> open file “GAME-FILENAME” of folder “GAME-LOCATION-PATH” of disk “GAME-LOCATION-DISK”
>end tell
>
>on idle
> tell application “Finder”
> set x to every process
> set y to application “GAME-FILENAME”
> if y is in x then
> return idlePeriod
> else
> delay 5
> put away disk “ISO-DISC-NAME”
> quit me
> end if
> end tell
>end idle
>
>on quit
> continue quit
>end quit
The below might be obvious to applescripters but I am describing it in great detail for posterity.
Where it says “ISO-FILENAME” you would write out the name of the disk image file as it appears in the Finder.
Where it says “ISO-LOCATION-PATH” you would write out the path to your image. For example, if your image is named “CD Image.iso” and is located in your Applications folder, then this whole line would read:
open file “CD Image.iso” of folder “Applications” of startup disk
Where it says “ISO-LOCATION-DISK” you can put the name of the disk on which the ISO resides, or if it’s on your startup disk you can just put “of startup disk.”
Where it says “GAME-FILENAME” that is the name of the executable application file as it appears in the Finder.
Where it says “GAME-LOCATION-PATH” you would write out the path to your game. For example, if your game is named “Warcraft II” and is located in your Applications folder, then this whole line would read:
open file “Warcraft II” of folder “Applications” of startup disk
Where it says “GAME-LOCATION-DISK” you can put the name of the disk on which the game resides, or if it’s on your startup disk you can just put “of startup disk.”
After writing out the script, you click on “check syntax” and it should ask you where is the application “GAME-FILENAME”. Use the open dialog box to browse to the location of that application.
In order for it to run, it must be saved as run-only, as an application, with the flags for “stay open” and “never show startup screen”
-
but is it a good idea to let a clock run in applescript while a game runs?