Find Mac OSX version installed using AppleScript

前端 未结 7 2218
夕颜
夕颜 2021-02-15 04:23

How can I find which version of OSX is installed on my Mac by using AppleScript? I want to install an app programatically and run different pkg files based on the version.

7条回答
  •  一整个雨季
    2021-02-15 04:42

    Here is how to get OSX version in AppleScript, using built-in functions:

    set sysinfo to system info
    set osver to system version of sysinfo
    

    On OS X Mavericks the result is "10.9".

    One-liner: set osver to system version of (system info)

提交回复
热议问题