Teacher Tech blog with Alice Keeler

Paperless Is Not a Pedagogy

Alice Keeler

You Can Copy Paste, So You Can Code

You Can Copy Paste, So You Can Code

If you can copy and paste you can code

Coding Requirements: Copy and Paste

I code with Google Apps Script which is based on JavaScript. How do I code… I copy and paste. There is a TON of sample code out on the Internet that you can steal. At first, I would copy and paste code. Then I would need to read through it and figure out what I needed to adjust. I copy and paste a lot less code now, by using “analyze over memorize” I got this!


You can create a new script at script.google.com. Choose “New script” in the upper left hand corner.
new script

Try This

create a Google Doc

Copy and paste the code below into the script editor.

function createDoc() {

DocumentApp.create(‘Alice Keeler Document’);


Now, modify it! After copying and pasting the code, try to make sense of it and modify it slightly!

Breaking Down the Code

1. function

You can have more than one function. A function is a chunk of code. It starts with lowercase function and then a space and then what you want to name the function. Note that your function name can not have a space. To use more than one word, smash the words together and capitalize the 2nd word.

Remember function notation from algebra? f(x) = x + 2.
The function f has a parameter (x). If you had f(5) you would replace all the x’s with 5’s. f(5) = (5) + 2.
It’s like that!!! Except usually, I do not have parameters when I code so it’s more like f().
So you need the empty parenthesis to say that your function does not have parameters!

2. Curly Braces

Curly braces trap the code for that function.

3. What App Are You Using?

Typically my first line of code is “What Google App are you using?” In this case I am coding a Google Doc so it is DocumentApp. Notice the capital D and A. It’s important.

4. Period

When you type a period in Google Apps Script it will give you a multiple choice menu for what methods (code) you can use. The awesome thing about Google Apps Script is that it is super readable!

5. Create

Reading the list of multiple choice options one of them says “Create().” I KNOW WHAT THAT DOES! It will create a Google Doc. In the parenthesis you can name the Google Doc you are creating! I named mine ‘Alice Keeler Document.’ Notice the single quotations! All text strings (stuff you want to type) must be in quotations.

6. Semicolon

At the end of each line of code you want to have a semicolon!

Save and Run

Modify something small! (Hoping you changed what I named the document) then press the save button (or Control S) and press the Run button (triangle icon.) You will be prompted to name the script and authorize the script. You may get a screen that has a button that says “Return to safety.” Ignore that button and click on “Advanced” and then click on the link that says “unsafe” (it is safe, you coded it so you know it is not malicious code.)

Check Google Drive

You just created a Google text document. Check recent to see if it worked!

Now Modify

We used DocumentApp to create a new Google Doc. Do you think you can create another type of Google App?



On the Google Apps developer site is sample code you can copy and paste!! Check out this page for DocumentApp. Scroll through and find code that you can copy and paste!
copy Google Docs

Modify My Code


Copy and paste MY scripts! Go to my scripts page make a copy of one of my templates. Use the Tools menu and choose “Script editor.”

alice keeler codes

5 Easy Steps for Teaching with Digital Tools

Introducing digital tools into your teaching can seem challenging at first. There are many tools out there, and it might feel like there’s a lot to learn. But with easy steps for teaching with digital tools, you can start simply and gradually. There’s no need to dive in all at once – just take it one step at a time. Taking easy steps for teaching with digital tools starts with trying something!

Read More »
Students Prepare to Present

Help Your Students Prepare to Present

Maximize student success in presentations with ‘Speaker Notes by AliceKeeler,’ the ideal Google Slides add-on. Enhance how students prepare to present with easy transfer of speaker notes to Google Docs, promoting effective communication skills. Dive into the world of engaging, technology-aided presentations and empower students to shine in their academic endeavors. Discover the key to transforming student presentations into interactive, skill-building experiences.

Read More »

Infographic 7 Basic Steps for a Google Form

New to using Google Forms? This tool is essential for teachers to not only save time but to be adaptive to student needs. Use Forms to survey students, play games, personalize instruction, and assessment. This infographic on the 7 basic steps for a Google Form will help you get started.

Read More »

Online Workshop: Get Your Add-on Published

How can you make Google Workspace (Docs/Sheets/Slides) even better? You can create custom Add-ons with Google Apps Script. Wondering How to Get Your Google Workspace Add-on Published? Join Alice Keeler, Google Developer Expert, to learn the steps to get your Add-on officially published.

Read More »

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.