title: "It is necessary to detach the element" error in google docs script
body: <p>When I try to copy paragraphs form one doc to another I get unexpected error: <br></p>
  
  <blockquote>
    <p>It is necessary to detach the element</p>
  </blockquote>
  
  <p>What does it mean? What am I doing wrong?</p>
  
  <pre><code>function test_copy_paragrahps() {
    var final = 'final';
    var doc1 = get_doc('', final);
    var doc2 = create_doc_in_path('', final+'test');
    var body1 = doc1.getBody();
    var body2 = doc2.getBody();
    var par1 = body1.getParagraphs();
    for (var i=0;i&lt;par1.length;i++) {
      body2.insertParagraph(i, par1[i]);
    }
  }
  </code></pre>
  
  <p>here is video <a href="http://youtu.be/1WdCD5ATiYw" rel="noreferrer">http://youtu.be/1WdCD5ATiYw</a></p>
  
  <p>P.S. You can not mention on get_doc and create_doc_in_path implementations. Both return Document object.</p>