Sorry not an expert in appscript, but need some help with (automating) copy-pasting gsheets. I have a gsheet at work, that needs copy-pasting a lot of rows and columns into other gsheets. The problem is - this source gsheet takes nearly 30 min to load all the values(due to different formulas).
I am trying to automate this copy-pasting process, through appscript but I am stuck at the very first step. I can't even get the appscript to print the names of sheets. The script runs for a few mins and then times out. So I wrote a script where it 'waits' for 30 min,(hopefully by that time the gsheets finishes loading) and then starts copying the values I want. It looks like this:
function getallsheetnames() {
Utilities.sleep(300000)
//var lock = LockService.getScriptLock();
// Wait for up to 30 min for other processes to finish.
//lock.waitLock(300000);
var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
console.log(sheets)
}
The problem is the script times out, even though it is told to sleep for 5 min. What can I do? any help will be greatly appreciated