As discussed in the SlidesYearbook Portrait Script – beta blog, the purpose of this project and add-on is to greatly reduce the price of yearbooks. Since this website was launched in 2016, students across the world have used the website to collaboratively create their yearbook in Google Slides. The cost of SlidesYearbook is the price to print it.
My goal this summer is to complete a beta version of the SlidesYearbook portrait add-on and make the process even easier. No one wants to hand insert 700 individual student portraits. Technically, this is the third version of the script. I was so excited about the new possibilities that I didn't write a blog post about the second version.
This blog post will include what the script can do as of July 5, 2019, with room for improvement.
SlidesYearbook Logo

Version 3 has a Sidebar, which is the perfect place for a SlidesYearbook logo. I used two different graphic designers on Fiverr and colleagues like Alice Keeler to design a logo. I am still in the final decision stage but this is the one that has received the most votes.
Menu and Sidebar
Version 1 of the add-on used a separate drop down menu for each step. Because users now have the option on how they upload portraits, multiple sidebar menus were necessary.
The Main Sidebar includes the steps needed to prepare the images and names for the Autocrat add-on. At the bottom of the Main Sidebar is a link to install Autocrat and a link to directions. The Portrait Sidebar offers the user a choice between importing or uploading portraits. While I was writing this blog, I realized that I had not created the Template Sidebar, but I have since fixed that. This sidebar will offer multiple choices for pre-made portrait layouts.
Import/Upload Portraits: Import from Drive
During version 1 and 2, I focused on uploading individual portraits using a Google Form. But this is not realistic.
Our professional photographer gives us a weblink and a CD to access student portraits. Last spring I used Files Cabinet by Awesome Table add-on to list and link to the images in a Google Drive folder, so I knew that I could code this action. The question was - how?
The answer came from a YouTube video called Google Apps Script - Google Drive Tutorial, Files, Folders, Copy Files, DriveApp, Iterator - Part 15 by Learn Google Sheets. I should say half of the answer came. After the video, I knew how to make a list of files and their links from a folder I named in the script. The next problem was - how do I code finding the user's Google Drive folder before the files are list?
I also wanted to learn how to change that folder's share permissions (a requirement for Autocrat).
I am a student in Alice Keeler's Go Slow Coding Coding Workshop. This week, I will start my fourth coding class with her. One lesson Alice gives is to explore her scripts and learn from them. On Friday, I found Student Critique. I started to modify her code that night and the next day my friends and I drove to Fresno, California for a face-to-face workshop.
By the end of the training, I had coded importing the image files and organizing the columns. I even coded conditional formatting to identify potential problems with the split names. I even added a sort for those potential name errors and kept the name of the original file in Column A.
Room for Improvement for Import from Drive
What problems could arise? A student may have two first names (like Mary Elizabeth or Jose Luis) or a student may have two last names that are not hyphenated (like Garcia Sanchez). I think I need to code an If { else command, but I am still learning.
Another potential problem is naming convention. I used the naming convention that our photographer used - SECTION_FIRST_LAST. Other photographers may use a different naming convention.
I also need to know how the Change Case add-on works. What separated Compton Jr. High's yearbook from the other schools in our district who used the ancient photographer software was that their names were all capitalized while ours were a much nicer title case.
The above problems may be null and void because, as Alice pointed out in a class message today, if I rely on the file names to pull the section first name, and last name, I am setting myself up for problems. Our school photographer uses that naming convention. What about other photographers?
How can I add a Google Form so that individual portraits can be added for new students?
Lastly, I want to move changing the folder view permissions to another step. The problem is when I delete the code (that I copied and pasted), the function stops working.
Import/Upload Portraits: Upload with Google Forms
I removed the required email question. It may come back later if I see the need. For example, students may want to submit their own photo and edit the response at a later time.
I also reordered the questions. I need the columns for Import and Upload to match. When the imported files' names are split, there may be more than 2 columns.
I also added the links to Edit and Submit the newly created Google Form.
Room for Improvement for Upload with Google Forms
Is it possible to code the first question as an Upload file? At this time, the user must manually change the Short answer question to the required Upload file option.
Manually Fix Names and then Sort
Originally sorting was a part of "Prepare Sheets." I changed this to a separate step because the user may want to check names before running the yearbook portrait set up.
Room for Improvement
I discovered an error in the previous step. If a student had a second last name, the rows did not properly adjust. For example, Katie McNamara became Katie McNamara Barras.
I also thought about a problem for Elementary schools. Some classes may have 20 students. Other classes 28 or 36. How can I add filler rows to separate sections/classes?
Prepare Sheets
Form Responses 1
In version 3, I re-ordered the columns. The position for Image (with uc?export=view&) and Combined name is crucial for the Prepare Sheets step.
Transpose
In version 2, the combined formula in A2 that included Q2 had to be separated because it stopped working. As a solution, I separated them. It worked fine, but when I repeated the macro in Version 3, it stopped working. I ran the macro again.
Use for merge
I made no change on this sheet.
Room for Improvement for Prepare Sheets
I want to combine the formulas in A2 on the Transpose sheet. I also want to write a code that repeats the formula without copying/pasting it 63 times.
I also want to give the user the option to have 16 or 20 images per page. I did attempt this, but I received errors when testing it. Adding columns and rows is not easy, but I will figure it out.
SlidesYearbook Template
Well, it looks like I missed a step in the sidebar. In all honesty, I was focusing on the Import from Google Drive option.
Room for Improvement
Add this step to the Sidebar. I also want to add a separate Template Sidebar where the user has an option of templates to choose.
Change Share Settings
I did not work on this section. I know the command. I know how to show picker so that the user can access the selected folder. When I fix the code from Import from Drive, I will bring that code down here.
Conclusion
The script is getting better and I am enjoying the process. The cool part about coding is problem-solving. I will start a new version of the script today. My plan is to post the beta version of the script on my website by the end of July. The section will include templates not just for SlidesYearbook Portraits, but also Name badges and School ID cards. Thank you, Katie McNamara, for the ideas!