Skip to content

Instantly share code, notes, and snippets.

@alexkaessner
Created October 13, 2022 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexkaessner/10d2070f0a556ba128747e33c3b11fc3 to your computer and use it in GitHub Desktop.
Save alexkaessner/10d2070f0a556ba128747e33c3b11fc3 to your computer and use it in GitHub Desktop.
AppleScript to retrieve the version and build number of the frontmost/open app.
tell application "System Events"
set activeApp to first application process whose frontmost is true
set appName to name of activeApp
set plistFile to (path of alias of file of activeApp & "Info.plist") as text
tell property list file plistFile
set appVersion to value of property list item "CFBundleShortVersionString"
set appBuild to value of property list item "CFBundleVersion"
end tell
end tell
set appInfo to appName & " " & appVersion & " (" & appBuild & ")"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment