Get the version of an application in AppleScript

Posted in AppleScript on October 04, 2016 · 1 min read
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:

tell application "Finder"
    version of AppleScript
end tell

Result: "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:

if version of AppleScript as string is greater than "1.8" then
    display 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:

use AppleScript version "2.4"

as the first line in you script.

If we wanted the current version of our operating system:

tell application "Finder"
    set operatingVersion to version
    display dialog operatingVersion
end tell
Help the site go ad free:
Storm Trooper