• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: OS version?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OS version?


  • Subject: Re: OS version?
  • From: John Baltutis <email@hidden>
  • Date: Thu, 15 May 2003 20:54:34 -0700

On 5/15/03, Emmanuel <email@hidden> wrote:
>
> --------------------------
> do shell script "defaults read | grep SystemVersionStampAsString"
> --------------------------
>
> is approximately 3000 times slower than:
>
> --------------------------
> system attribute "sysv"
> --------------------------

This only gives you->4134

Try:

copy my gestVersion_info("sysv", 4) to version_string
version_string

on gestVersion_info(gestalt_code, increment_value)
try
tell application "Finder" to ,
copy my NumToHex((system attribute gestalt_code),
increment_value) to {a, b, c, d}
if a is "0" then set a to ""
set the version_string to (a & b & "." & c & "." & d) as string
return version_string
on error
return "unknown"
end try
end gestVersion_info

on NumToHex(theNumber, stringLength)
set hexString to {}
repeat with i from stringLength to 1 by -1
set hexString to ((theNumber mod 16) as string) & hexString
set theNumber to theNumber div 16
end repeat
return (hexString as string)
end NumToHex

which gives you->"10.2.6"
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: OS version?
      • From: Paul Skinner <email@hidden>
  • Prev by Date: Re: Printing from FileMaker as an attachment using Apple Script...Sound Interesting?
  • Next by Date: Re: OS version?
  • Previous by thread: Re: OS version?
  • Next by thread: Re: OS version?
  • Index(es):
    • Date
    • Thread