Category: Tips

Handling Text Strings

Text Strings When writing a text string you place your text within single quotations. var cat = ‘The cat is on the porch’; Line breaks \n To create line breaks¬†within a text string use \n. This slash is above the enter key. NOT the slash on the question mark key. Do not put spaces before […]


Repeat: Making a For Loop

google apps script for loop

The For Loop By Alice Keeler The For loop is the key to making code really useful. It makes light work of a tedious process of repeating something. Code for(var i = 0; i < 10; i++){ } What this says is for as long as the middle statement is true, run the code in […]


Tip: Use Comments In Your Code

Use Comments

Tip: Use Comments In Your Code By Daniel J. VandeBunte Writing a successful program requires a clear thought process about what the program will do. One thing beginning coders should get in the habit of doing is using code comments to guide their thinking as they write their program. Every programming language I have ever […]


Prompt User for Information

Prompt User for Information by Alice Keeler When using Google Apps script sometimes you need to ask the user for some information. First you need to call up the user interface for the app you are using. Prompt the user and then get the response. Here is some sample code for you to copy and […]


Combining Text and Variables

Combining Text and Variables by Alice Keeler One of the scripts I wrote changes the document title of student work to indicate it has been graded. To do this, I need to combine the text string ‘Graded’ with the original document title which is defined by a variable. Plus To join a text string and […]


Test for “OR”

My JavaScript knowledge is pretty limited, I like to say I’m a teacher not a programmer. I’m always excited to learn a new tip. Today @flubaroo¬†was able to help me with a little of my code and showed me some new tricks. In an if else loop, I can test for one condition OR another […]