AI-generated Key Takeaways
-
This script automates the creation of a Google Doc and emails you a link for access.
-
You'll need a Google Account and web browser to use this automation script.
-
The script involves pasting provided code into the Apps Script editor and running it after authorization.
-
Upon successful execution, you'll receive an email containing the link to your newly created Google Doc.
-
Explore further options to extend functionalities with Google Docs, Sheets, and Slides or learn basic JavaScript.
Build and run a simple automation that creates a Google Docs document and emails you a link to the document.
Objectives
- Set up the script.
- Run the script.
Prerequisites
To use this sample, you need the following prerequisites:
- A Google Account (Google Workspace accounts might require administrator approval).
- A web browser with access to the internet.
Set up the script
To build the automation, take the following steps:
- To open the Apps Script editor, go to
script.google.com
. If this is the first time you've been toscript.google.com
, click View Dashboard. - Click New project.
Delete any code in the script editor and paste in the code below.
Click Save
.
Click Untitled project.
Enter a name for your script and click Rename.
Run the script
To run the script, take the following steps:
- Click Run.
When prompted, authorize the script. If the OAuth consent screen displays the warning, This app isn't verified, continue by selecting Advanced > Go to {Project Name} (unsafe).
When the script execution completes, check your Gmail inbox for the email.
Open the email and click the link to open the document that you created.