• 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: sysv and OS X 10.4.10 and .11
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sysv and OS X 10.4.10 and .11


  • Subject: Re: sysv and OS X 10.4.10 and .11
  • From: "Mark J. Reed" <email@hidden>
  • Date: Fri, 21 Dec 2007 07:28:47 -0500

On Dec 21, 2007 3:56 AM, Philip Aker <email@hidden> wrote:
set cv to ( do shell script "sw_vers -productVersion | cut -d '.' -f 1-2 | tr -d .") 

Well, that works.  There'll be a big numeric jump from 109 to 1010, but as long as you're only looking at the first two components, at least it's monotonically increasing.

One way to do correct version comparison is to use the sort command:

set lowerVersion to (do shell script "(sw_vers -productVersion; echo 10.5) | sort -n -t. -k1,1 -k2,2 | head -n 1")
if lowerVersion is " 10.5" then
    display dialog "Welcome to Leopard! (Or later!)"
else
    display dialog "Tiger or earlier"
end if





if (higherVersion

--
Mark J. Reed < email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: sysv and OS X 10.4.10 and .11 (From: Philip Aker <email@hidden>)

  • Prev by Date: Re: Bash to AppleScript? (Is this possible to do with AS?)
  • Next by Date: Re: OS X, 10.1 and Above - Append PDF files Using Applescript
  • Previous by thread: Re: sysv and OS X 10.4.10 and .11
  • Next by thread: Help with mail please
  • Index(es):
    • Date
    • Thread