[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(DTPtechNote:930) OS X Version Checking



本家applescript-usersの引き写しなんだけど

to GetOSVers()
    set hexVers to system attribute "sysv"
    set thous to hexVers div 4096
    set hexVers to hexVers mod 4096
    set huns to hexVers div 256
    set hexVers to hexVers mod 256
    set tens to hexVers div 16
    set ones to hexVers mod 16
    set osVers to (thous as string) & huns & "." & tens & "." & ones
end GetOSVers

GetOSVers()
--> "10.3.5"

または

set hexVers to system attribute "sysv"
if hexVers < 4133 or hexVers >= 4144  then -- < OS 10.2.5 or >= 10.3.0