This is a Google Apps Script script written in TypeScript using clasp that allows the user to convert all Google Docs/Slides/Sheets into Microsoft Office formats
I plan to add logic for conversion in the opposite direction but it has not been a priority.
Caution
By nature this is a risky script to run. I have taken precautions to minimize the dangerous operations but, run it at your own risk and review the code.
- The script will only create copies of documents in directories you own.
- The script will only create an office version of your document if there is no office file with the same name that has a newer timestamp.
Make sure you enable the Google Apps Script API for your Google Account.
# Install clasp
npm install -g @google/clasp
# Login into your google account with clasp
clasp loginFor anyone other than the original author, please remove the .clasp-dev.json
and .clasp-prod.json files and initialize them again using clasp create.
This clasp configuration is set to my own instance of the script on my Google account to which you likely have no access.
Therefore run the following commands before doing anything
rm .clasp.json
# Create a new standalone script in your account
clasp createnpm run lintnpm run testnpm run deploy
npm run deploy:prod