Differentiating Classic from OS9

Ken Ray kray at sonsothunder.com
Wed May 3 11:39:54 EDT 2006


On 5/3/06 7:04 AM, "revolution at duncansoftware.com"
<revolution at duncansoftware.com> wrote:

> 
> 
> 
> 
> The systemversion returns 9.2.2 in both Classic (on OSX) and on a real OS9
> box. I 
> 
> need to differentiate between them.

Here's how to tell if Classic mode is running on the computer:

function stsIsClassicModeRunning
  put format("tell app \"Finder\"\nget the processes\nend tell") into tAS
  do tAS as "AppleScript"
  put format("application process \"Classic Support\"") into
tClassicProcName
  return (the result contains tClassicProcName)
end stsIsClassicModeRunning


And here's how to tell if your stack is actually running in an app under
Classic mode, or whether it is running in an app in OS X (watch for line
wraps):

function stsInClassicMode
  -- First, check to see if we're running on OS X
  if the fileName of this stack contains "Contents/MacOS/" then return
"false"
  
  -- Second, check to see if the process "Classic Support" is in
  -- the current process list. This will be true when running in OS X
  -- Classic mode, but will be false if running in OS 9.
  -- If true, then the app is a PPC app and Classic Mode is running, so it
  -- must be running in Classic Mode.
  -- If false, then the app is a PPC app and Classic Mode is *not* running,
  -- which would mean that the app is running in OS 9 and not in
  -- Classic Mode.
  return stsIsClassicModeRunning()
end stsInClassicMode

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list