Click on the arrows below to read the script. Yes, you may copy and paste.
Name the file in the top right corner.
function createSlides() {
var slides=SlidesApp.create('I coded this');
}
Go to script.google.com.
Click on +.
Copy/paste the above code.
Do you see createSlides? Do you see that the first word is not capitalized but that the second word is capitalized? This is important.
Do you see the curly cue brackets? What has a beginning also has an end.
Notice the semi-colon ; It acts like a period.
Look for 'I coded this.' Change the phrase to something new like 'Coding is AWESOME!'
Click the Save icon to save the script. You will be asked to give permission for Google to run the script you wrote.
Now click Run the script.
Open to Recent folder in Google Drive to see your work.
function colorSlides() {
var slides = SlidesApp.create('I coded this');
var slidesWorkspace = slides.appendSlide(SlidesApp.PredefinedLayout.TITLE);
slidesWorkspace.getPlaceholder(SlidesApp.PlaceholderType.TITLE);
slidesWorkspace.getBackground().setSolidFill('#FF3366');
}
Copy and paste the above code.
Now look for #FF3366. This is called a hex code. It has six digits - 2 per color.
#000000 is black
#990000 is red
#009900 is blue
#000099 is green
Click here for more hex codes
Save the script and then run it.
Go to the Recent folder in Google Drive to see your work.
function colorSlides() {
var slides=SlidesApp.create('Color Slides');
var color=slides.appendSlide(SlidesApp.PredefinedLayout.MAIN_POINT);
color.getBackground().setSolidFill('#000099');
var color2=slides.appendSlide(SlidesApp.PredefinedLayout.MAIN_POINT);
color2.getBackground().setSolidFill('#009900');
var color3=slides.appendSlide(SlidesApp.PredefinedLayout.MAIN_POINT);
color3.getBackground().setSolidFill('#990000');
var color4=slides.appendSlide(SlidesApp.PredefinedLayout.MAIN_POINT);
color4.getBackground().setSolidFill('#990000');
}
function colorSlides(){
var slides = SlidesApp.create('Unicorn');;
var color = slides.appendSlide(SlidesApp.PredefinedLayout.BLANK);
color.getBackground().setSolidFill('#999999');
}
function spaceUnicorn() {
var star = SlidesApp.create('No Evil Hacking');
star.addEditor('email@domain.com');
star.addEditor('email@domain.com');
star.appendSlide(SlidesApp.PredefinedLayout.BLANK).getBackground().setSolidFill('#000099');
star.appendSlide(SlidesApp.PredefinedLayout.BLANK).insertShape(SlidesApp.ShapeType.CLOUD);
}
The name of the function and variant can be whatever you want. Notice the capitalization.
By learning code from me, you are promising NOT to be evil.
In this code, we are sharing the new slide with two people.
Slide 2 is blue.
Slide 3 has a cloud shape on it