title: Transferring ownership in GDrive per Script
body: <p>When I use my script to transfer ownership of a folder it moves the folder to the new owner's &quot;shared with me drive&quot; instead of &quot;My drive&quot;.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function myChangeOwnerCreateList() {
      var myfolders = DriveApp.searchFolders('"me" in owners');
  
      let toOwner = "max.mustermann@google.com";
     
      while (myfolders.hasNext()) {
        var folder = myfolders.next();
        var myName = folder.getName();
        var myID = folder.getId();
        var myURL = folder.getUrl();
        Logger.log(myName)
        folder.addEditor(toOwner);
        folder.setOwner(toOwner);
      }
  }</code></pre>
  </div>
  </div>
  </p>
  <p>The owner is set correctly, only the new owner cannot see the files immediately because they are under &quot;Shared with me&quot;.</p>
  <p>Where is my bug?</p>