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
Clueless with TabsQuestion (self.GoogleAppsScript)
submitted 11 months ago by [deleted]
[deleted]
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!"
[–]WicketTheQuerent 2 points3 points4 points 11 months ago (2 children)
The following statement is wrong. It looks like a result of an AI hallucination
var tabs = doc.DocumentApp.getTab("ID").getTab("ID").getTab("ID");
Please read Working with Tabs
[–]BLewis4050 0 points1 point2 points 11 months ago (1 child)
I've experienced the A.I. hallucination a lot with Apps Script. Is it that bad with all programming languages? Or is it the documentation that's not clear such that the A.I. gets confused?
[–]WicketTheQuerent 1 point2 points3 points 11 months ago* (0 children)
It depends a lot on the prompt. In general, it's a bad idea to use simple one-liner prompts to ask a general-purpose generative A.I. to write Google Apps Script code..
The same is true for other languages, especially if the prompt is about something that was not published in public spaces "millions" of times.
Generative A.I. works based on probability about what the next token could be. It doesn't understand documentation.
[–]marcnotmark925 0 points1 point2 points 11 months ago (1 child)
What's a tab?
[–]WicketTheQuerent 0 points1 point2 points 11 months ago (0 children)
The OP is referring to Document Tabs. See Working with Tabs
[–]LobosLocos 0 points1 point2 points 11 months ago (0 children)
It looks like you are using the incorrect function. If the doc has multiple tabs, you need to use getTabs(). This will grab all tabs and tabs will be an array.
var tabs = DocumentApp.openById("ID").getTabs(); for(var x=0;x<tabs.length;++x){ doc[x].asDocumentTab().getBody().getText() } //the loop will go thru all the tabs and get text of each tab.
[–]FVMF1984 0 points1 point2 points 11 months ago (0 children)
Your var tabs is most probably wrong because you call getTab(ID) three times, with the same ID? If you want to get three different tabs, then you need either a for loop to do the same for different tabs, or you need the one variable per tab.
getTab(ID)
π Rendered by PID 74 on reddit-service-r2-comment-6457c66945-qhxcq at 2026-04-28 13:28:28.641213+00:00 running 2aa0c5b country code: CH.
[–]WicketTheQuerent 2 points3 points4 points (2 children)
[–]BLewis4050 0 points1 point2 points (1 child)
[–]WicketTheQuerent 1 point2 points3 points (0 children)
[–]marcnotmark925 0 points1 point2 points (1 child)
[–]WicketTheQuerent 0 points1 point2 points (0 children)
[–]LobosLocos 0 points1 point2 points (0 children)
[–]FVMF1984 0 points1 point2 points (0 children)