vartab=DocumentApp.getActiveDocument().getActiveTab();//UsegetType()todeterminethetab's type before casting.if(tab.getType()==DocumentApp.TabType.DOCUMENT_TAB){//It's a document tab, write some text to it.tab.asDocumentTab().setText('Hello World!');}else{//TherearecurrentlynotypesotherthanDOCUMENT_TAB.}
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-08-20 (世界標準時間)。"],[[["`TabType` is an enumeration used to identify different tab types within a Google Doc."],["Currently, `DOCUMENT_TAB` is the only available tab type, representing a document tab that can be interacted with using the `DocumentTab` class."],["You can determine the type of a tab using `getType()` and then perform actions based on its specific type, such as adding text to a `DOCUMENT_TAB`."]]],[]]