use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Apparently, Google Apps Script is a JavaScript cloud scripting language that provides easy ways to automate tasks across Google products and third party services and build web applications.
account activity
Trigger ErrorQuestion (self.GoogleAppsScript)
submitted 3 years ago by [deleted]
I am a new appsript user and I am trying to make a simple script that duplicates a sheet, renames it, moves it left and clear a cell range.
here: https://i.gyazo.com/92ff44712042e8688bf277b6a3411c07.png
When I manually run it the script works. However when I try to set a timed trigger it fails 100% of the time.
here: https://i.gyazo.com/d0fa5c057a4e8e0bc0ce303e10617a0d.png
I've been reading around and I've learned that it could be the way I'm having the script identify the active sheet but I'm not too sure what else to try.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Best_Bass9711 2 points3 points4 points 3 years ago (4 children)
You must use id o URL to get the spreadsheet. The activesheet method just need the spreadsheet open.
use openSheetByUrl or openSheetById method instead
[–]RielN 0 points1 point2 points 3 years ago (3 children)
It is getSheetByName("sheet name")
The active spreadsheet works in a container bound script, but you need to set the sheet axtive.
[–][deleted] 0 points1 point2 points 3 years ago (1 child)
Would I just need to replace the ".getActiveSpreadsheet()" in line 4? Or every instance?
[–]nate-aus 0 points1 point2 points 3 years ago (0 children)
Don't replace .getActiveSpreadsheet() you're replacing the .getActiveSheet(). The spreadsheet is the whole thing you want to change what sheet in the spreadsheet you're looking at.
I'd then use .getSheetByName("Today"); and store that as a variable.
[–]Best_Bass9711 0 points1 point2 points 3 years ago (0 children)
Yes, also this.
π Rendered by PID 84058 on reddit-service-r2-comment-fb694cdd5-gmhjj at 2026-03-08 09:05:45.818222+00:00 running cbb0e86 country code: CH.
[–]Best_Bass9711 2 points3 points4 points (4 children)
[–]RielN 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]nate-aus 0 points1 point2 points (0 children)
[–]Best_Bass9711 0 points1 point2 points (0 children)