A couple of Classic management scripts

Feb 01, '02 12:27:05AM

Contributed by: robg

From a contributor who wishes to remain anonymous, here are two scripts for dealing with Classic. The first script, "Classic Permissions", pops-up a dialog box that enables or disables future Classic launches. This can be handy if you're tired of Classic launching when you double-click an icon that is associated with Classic.

The second script, "Classic Single Serving", enables Classic, launches it, waits for it to finish launching, and then disables future launches.

Read the rest of the article for the scripts...

Classic Permissions

This script pops up a dialog box allowing you to Enable or Disable future Classic launches.

set ps to "enter your password here"

set pth to "'/System/Library/CoreServices/Classic Startup.app'"
do shell script "ls -l '/system/library/coreservices/classic startup.app'"
if result = "ls: Contents: Permission denied" then
display dialog "Classic is Disabled." with icon stop ¬
buttons ["ENABLE", "Cancel"] default button 2
do shell script "chmod 0754 " & pth password ps ¬
with administrator privileges
else
display dialog "Classic is ENABLED." with icon note ¬
buttons ["Disable", "Cancel"] default button 2
do shell script "chmod 0644 " & pth password ps ¬
with administrator privileges
end if
Classic Single Serving

This script Enables Classic, launches Classic, waits until Classic has finished launching, and then Disables future Classic launches.
global ps, pth
on run
set ps to "enter your password here"
set pth to "'/System/Library/CoreServices/Classic Startup.app'"
do shell script "chmod 0754 " & pth password ps with ¬
administrator privileges
tell application "Classic Startup"
activate
end tell
idle
end run

on idle
set xx to "Classic Startup"
tell application "Finder"
set yy to name of process xx
end tell
try
if yy = xx then set p to 1
set zz to 1 as boolean
on error
set zz to 0 as boolean
end try
if not zz then
do shell script "chmod 0644 " & pth password ps with ¬
administrator privileges
quit me
end if
return 5
end idle

Comments (7)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20020201002705542