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 UTC"],[[["`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`."]]],[]]