title: How to add a new slide with new layout on Google Slides?
body: <p>The following is what I did:</p>
  <ol>
  <li><p>Created a new presentation on Google Slides,</p>
  </li>
  <li><p>Edited one of the predefined layouts on the Master Layout view in
  order to have a new layout that I want to use,</p>
  </li>
  <li><p>Edited the name of the Master Layout to &quot;Meeting&quot;,</p>
  </li>
  <li><p>Edited the name of the predefined layout that I want to use to
  &quot;Office&quot;.</p>
  </li>
  </ol>
  <p>My problem is that on Google Script I am not being able to reference this specific predefined layout that I want to use.</p>
  <p>So far, my code is the following:</p>
  <pre><code>function AddSlideToPresentatio() {
  
  // The following line opens my presentation
  var presentation = SlidesApp.openById('PresentationID');
  
  //Now, I try to use my new layout
    presentation.appendSlide(&quot;Office&quot;);
  }
  </code></pre>
  <p>I have absolutely no idea on why this doesn't work. When I try to run it, I get the error:</p>
  <blockquote>
  <p>&quot;Cannot find method appendSlide(string). (line 6, file &quot;Office&quot;).</p>
  </blockquote>
  <p>The following are some of the combinations that I tried, and they get me similar errors:</p>
  <pre><code>presentation.appendSlide('Office');
  presentation.appendSlide(Office);
  presentation.appendSlide(&quot;Meeting - Office&quot;);
  presentation.appendSlide('Meeting - Office');
  presentation.appendSlide(Meeting - Office);
  </code></pre>
  <p>If I just use <code>presentation.appendSlide()</code> it creates a new slide, but not with the layout that I want to use.</p>
  <p>In the <a href="https://developers.google.com/apps-script/reference/slides/presentation#appendslide" rel="nofollow noreferrer">Google Apps Script Reference</a> there are three methods:</p>
  <ol>
  <li>appendSlide(),</li>
  <li>appendSlide(layout),</li>
  <li>appendSlide(predefinedLayout)</li>
  </ol>
  <p>However, I can't seem to understand what is the difference between that last two, because when I try to use them they seem to do the same thing.</p>