查找使用 AppleScript 安装的 Mac OSX 版本 [英] Find Mac OSX version installed using AppleScript

查看:32
本文介绍了查找使用 AppleScript 安装的 Mac OSX 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 AppleScript 查找 Mac 上安装的 OSX 版本?我想以编程方式安装应用程序并根据版本运行不同的 pkg 文件.

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.

谢谢

推荐答案

我不在 Mac 上,所以可能有更好的方法来执行此操作,但我想到的第一种方法只是执行 shell 命令查询操作系统版本.

I'm not on a Mac, so there may be a better way to do this, but the first approach that comes to mind is just executing a shell command to query the OS version.

http://developer.apple.com/technotes/tn2002/tn2065.html#TNTAG2

http://developer.apple.com/文档/Darwin/Reference/ManPages/man1/sw_vers.1.html

根据这些参考资料,您可能想要执行以下操作:

Based on these references, you probably want to do something like:

set os_version to do shell script "sw_vers -productVersion"

这篇关于查找使用 AppleScript 安装的 Mac OSX 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆