Class Tab

टैब

Google Docs के दस्तावेज़ में मौजूद एक टैब.

// Get all of the first-level tabs (tabs that are not nested within a parent tab) in the
// document.
var tabs = DocumentApp.openById('abc123456').getTabs();

// Get a specific tab based on the tab ID.
var tab = DocumentApp.openById('abc123456').getTab('t.0');

तरीके

तरीकारिटर्न टाइपसंक्षिप्त विवरण
asDocumentTab()DocumentTabटैब के कॉन्टेंट को DocumentTab के तौर पर वापस लाता है.
getChildTabs()Tab[]इस टैब में नेस्ट किए गए चाइल्ड टैब वापस लाता है.
getId()Stringटैब का आईडी वापस लाता है.
getIndex()Integerपैरंट में टैब के 0-आधारित इंडेक्स को हासिल करता है.
getTitle()Stringटैब का शीर्षक वापस लाता है.
getType()TabTypeटैब के टाइप की जानकारी हासिल करता है.

विस्तृत दस्तावेज़

asDocumentTab()

टैब के कॉन्टेंट को DocumentTab के तौर पर वापस लाता है.

वापसी का टिकट

DocumentTabDocumentTab के तौर पर टैब.


getChildTabs()

इस टैब में नेस्ट किए गए चाइल्ड टैब वापस लाता है.

वापसी का टिकट

Tab[] — इस टैब में नेस्ट किए गए चाइल्ड टैब.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getId()

टैब का आईडी वापस लाता है.

वापसी का टिकट

String — टैब का आईडी.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getIndex()

पैरंट में टैब के 0-आधारित इंडेक्स को हासिल करता है.

वापसी का टिकट

Integer — पैरंट टैब में मौजूद टैब का इंडेक्स.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getTitle()

टैब का शीर्षक वापस लाता है.

वापसी का टिकट

String — टैब का टाइटल.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getType()

टैब के टाइप की जानकारी हासिल करता है.

ज़्यादा कॉन्टेंट पर कास्ट करने से पहले, इस Tab का कॉन्टेंट टाइप तय करने के लिए, इस तरीके का इस्तेमाल करें asDocumentTab() का इस्तेमाल करके खास टाइप का डेटा एक्सपोर्ट करें.

var tab = DocumentApp.getActiveDocument().getTab('t.0');
// Use getType() to determine the tab'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 {
 // There are currently no types other than DOCUMENT_TAB.
}

वापसी का टिकट

TabType — टैब किस तरह का है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents