Skip to content

Instantly share code, notes, and snippets.

@vmwarecode
Created March 8, 2017 04:57
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 vmwarecode/2ee6017e389a9cf68c40ebe8e7a0bf94 to your computer and use it in GitHub Desktop.
Save vmwarecode/2ee6017e389a9cf68c40ebe8e7a0bf94 to your computer and use it in GitHub Desktop.
macOS - Custom Attributes to discover Microsoft Office 2016 for Mac versions
## WORD-VERSION ##
if [ -x "/Applications/Microsoft Word.app" ]; then /usr/bin/defaults read /Applications/Microsoft\ Word.app/Contents/Info.plist CFBundleShortVersionString ; else echo "0.0"; fi
## EXCEL-VERSION ##
if [ -x "/Applications/Microsoft Excel.app" ]; then /usr/bin/defaults read /Applications/Microsoft\ Excel.app/Contents/Info.plist CFBundleShortVersionString ; else echo "0.0"; fi
## ONENOTE-VERSION ##
if [ -x "/Applications/Microsoft OneNote.app" ]; then /usr/bin/defaults read /Applications/Microsoft\ OneNote.app/Contents/Info.plist CFBundleShortVersionString ; else echo "0.0"; fi
## POWERPOINT-VERSION ##
if [ -x "/Applications/Microsoft Powerpoint.app" ]; then /usr/bin/defaults read /Applications/Microsoft\ Powerpoint.app/Contents/Info.plist CFBundleShortVersionString ; else echo "0.0"; fi
## OUTLOOK-VERSION ##
if [ -x "/Applications/Microsoft Outlook.app" ]; then /usr/bin/defaults read /Applications/Microsoft\ Outlook.app/Contents/Info.plist CFBundleShortVersionString ; else echo "0.0"; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment