How can I get the current version of an application in AppleScript?
In AppleScript you can use the command version
to request the version of an application. Let's get the current AppleScript version:
applescripttell application "Finder"version of AppleScriptend tellResult: "2.4"
A great usage of the version command is if you need to use a particular application's version to do something. If you needed to use something greater than AppleScript version 1.8 you would create a condition:
applescriptif version of AppleScript as string is greater than "1.8" thendisplay dialog "greater than 1.8"end if
If you didn't want to check the current version but wanted to tell AppleScript what version to use:
applescriptuse AppleScript version "2.4"
as the first line in you script.
If we wanted the current version of our operating system:
applescripttell application "Finder"set operatingVersion to versiondisplay dialog operatingVersionend tell
Tags: conditional, version