Find Mac OSX version installed using AppleScript

前端 未结 7 2231
夕颜
夕颜 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:41

    You can get version from the Finder app as well

    tell application "Finder"
        set os_version to version
    end tell
    
    display dialog os_version
    

    On my machine this displays "10.5.8".

提交回复
热议问题