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

查看:186
本文介绍了查找使用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/文档/达尔文/参考/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天全站免登陆