Worklet: Install Microsoft Office on MacOS

Hi all,

Here is a method to install Microsoft Office 365 via a Worklet.

Basically it checks whether Word, Excel, PowerPoint and Outlook are installed, if not, it then downloads the pkg for MS Office which I got from and then installs from the /tmp/ directory, then removes the installer. You may want to change the download link if it expires or doesn’t work.



#Checks whether these .apps are installed in the /Applications directory, if not, Exit 1 code and goes to next step

if [[ -d /Applications/Microsoft\ && -d /Applications/Microsoft\ && -d /Applications/Microsoft\ && -d /Applications/Microsoft\ ]]; then
        echo "Microsoft Office is installed."
        exit 0
        echo "Microsoft Office is not installed."
        exit 1



echo -e "Downloading Microsoft Office..."

#Downloads MS Office pkg to /tmp/

curl -L -o "/tmp/mspkg.pkg"

echo -e "Installing Microsoft Office..."

#Runs the installer

sudo installer -pkg /tmp/mspkg.pkg -target /

echo -e "Cleaning up..."
rm -f "/tmp/mspkg.pkg"