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.
Try something along these lines:
tell application "Terminal" activate set theVersion to do script with command "sw_vers -productVersion" end tell
Edit : It was pointed out that this does open the terminal, and that probably isn't the behavior you want.