I've been trying to copy a range from a spreadsheet and paste into another spreadsheet on Google Docs. Whenever I run the script I get Target range and source range must be on the same spreadsheet
function myFunction() {
var ss1 = SpreadsheetApp.getActiveSpreadsheet ();
var ss2 = SpreadsheetApp.openById("1wIVQA-QhgSvTpmrIl4R6Gwhh1pMKcVKEcdFPa8_KTXw");
var source = ss2.getRange ("Moz!D2:J2");
var destiny = ss1.getRange("Sheet1!A2:B2");
source.copyTo (destiny, {contentsOnly: true});
source.clear ();
}
Apparently is possible but I couldn't work it out yet. Source: https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet-app