On 2/22/05 12:50 PM, "Frank D. Engel, Jr." <[EMAIL PROTECTED]> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Using "uname -m" yields "Power Macintosh", btw...

Here's a framework that I've started to get the computer name - I only have
OS X implemented, but I'll fill it in with Win32  (and hopefully OS 9) soon:

on mouseUp
  answer stsComputerType()
end mouseUp

function stsComputerType
  local tType
  switch (the platform)
  case "MacOS"
    if isOSX() then
      put shell("system_profiler SPHardwareDataType") into tData
      get matchText(tData,"(?s)Machine Model:\W*(.*?)\n",tType)
      if it is true then
        return tType
      else
        return "Error: Can't locate computer type."
      end if
    else
      -- No OS 9 version yet
    end if
    break
  case "Win32"
    -- No Win32 version yet
    break
  end switch
end stsComputerType

function isOSX
  set the itemDel to "."
  return (item 1 of the systemVersion >=10)
end isOSX

---

On my Mac, this returns 'PowerMac G4'.

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [EMAIL PROTECTED]



_______________________________________________
use-revolution mailing list
[email protected]
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to