This came out of personal research on the best way to "renice" apps using AppleScript, and was inspired by the posting on increasing Quake3 performance with a script. I came up with a good AppleScript to do that as well, but more on that later...
Following the example of the Quake3 script, I set it up to cd to:
/System/Library/CoreServices/Classic Startup.app/Contents/Resources/
and had it launch "TruBlueEnvironment". The cool thing about doing it this way is that it launches quietly in the background, with no progress bar or bouncing icon. This seems to make launching Classic faster.
I also wanted to set up the script to "renice" Classic to speed it up (I use it mostly just for "Baldur's Gate" ;). I at first tried to only use the new "do shell script" feature of AppleScript, but ran into a problem where it would hang the script until after Classic/TruBlue quit, even when I sent it to the background with '&'. After much experimentation and tweaking, I found the solution.
Read the rest of the article for the script (as well as a generic app launcher and renicer script)
Silent launch and renice Classic script:
property appPath : "/System/Library/CoreServices/Classic Startup.app/Contents/Resources/"[Depending on the performance of your Mac, you may need to modify the delays]
property appName : "TruBlueEnvironment"
tell application "Terminal"
do script with command "cd '" & appPath & "';./" & appName & "&;exit"
delay 6
quit
end tell
delay 1
do shell script "sudo renice -12 -p `ps -ax | awk '{ if¬
( /" & appName & "/ && $0 !~ /awk/ ) { print $1;exit } }'`"
property appName : "Quake3"I've found the best way to launch these is to use Apple's Script Menu. Not only is it a very convenient place to keep and launch such scripts, but you don't have to worry about keeping a seperate run-only version.
tell application appName
run
end tell
delay 1
do shell script "sudo renice -15 -p `ps -ax | awk '{ if¬
( /" & appName & "/ && $0 !~ /awk/ ) { print $1 } }'`"
Mac OS X Hints
http://hints.macworld.com/article.php?story=20020203225813222