Can't read text from file on OS 9

Ken Ray kray at sonsothunder.com
Wed Sep 22 21:27:49 EDT 2004


On 9/22/04 5:00 PM, "Richard Gaskin" <ambassador at fourthworld.com> wrote:

> What's needed is a function to determine whether we're running under 9
> natively or in Classic.

Here's one, it does the job but only when called by a standalone (adjusted
for email display):


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"
  end if
  
  -- 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


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

I'm sure this could be modified to be called from a stack instead of a
standalone...

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