I've this code in a google spreadsheet which works well when I run it with an interactive execution:
var originalSpreadsheet = SpreadsheetApp.getActive();
var original = originalSpreadsheet.getSheetByName("Sheet1");
var newSpreadsheet = SpreadsheetApp.create("New");
original.copyTo(newSpreadsheet);
But if I run it with a time trigger it creates correctly the "New" spreadsheet, but the copyTo command doesn't copy anything of the original spreadsheet in it.
Have I made some mistake?
I use Mac OS X Lion 10.7.5 and Chrome.