Class TableCell

TableCell

टेबल सेल को दिखाने वाला एलिमेंट. TableCell हमेशा TableRow में शामिल होता है. इसमें ListItem, Paragraph या Table एलिमेंट शामिल हो सकते हैं. दस्तावेज़ के स्ट्रक्चर के बारे में ज़्यादा जानने के लिए, Google Docs को एक्सटेंड करने से जुड़ी गाइड देखें.

तरीके

तरीकारिटर्न टाइपसंक्षिप्त विवरण
appendHorizontalRule()HorizontalRuleयह एक नया HorizontalRule बनाता है और उसे जोड़ता है.
appendImage(image)InlineImageयह फ़ंक्शन, दी गई इमेज के बड़े बाइनरी ऑब्जेक्ट (ब्लॉब) से नया InlineImage बनाता है और उसे जोड़ता है.
appendImage(image)InlineImageदिए गए InlineImage को जोड़ता है.
appendListItem(listItem)ListItemदिए गए ListItem को जोड़ता है.
appendListItem(text)ListItemयह एक नया ListItem बनाता है और उसे जोड़ता है.
appendParagraph(paragraph)Paragraphदिए गए Paragraph को जोड़ता है.
appendParagraph(text)Paragraphयह एक नया Paragraph बनाता है और उसे जोड़ता है.
appendTable()Tableयह एक नया Table बनाता है और उसे जोड़ता है.
appendTable(cells)Tableयह फ़ंक्शन, तय की गई सेल वाला नया Table जोड़ता है.
appendTable(table)Tableदिए गए Table को जोड़ता है.
clear()TableCellइससे एलिमेंट का कॉन्टेंट मिट जाता है.
copy()TableCellयह फ़ंक्शन, मौजूदा एलिमेंट की अलग की गई डीप कॉपी दिखाता है.
editAsText()Textबदलाव करने के लिए, मौजूदा एलिमेंट का Text वर्शन मिलता है.
findElement(elementType)RangeElement|nullयह फ़ंक्शन, एलिमेंट के कॉन्टेंट में, तय किए गए टाइप के डिसेंडेंट को खोजता है.
findElement(elementType, from)RangeElement|nullयह फ़ंक्शन, एलिमेंट के कॉन्टेंट में दिए गए टाइप के डिसेंडेंट को खोजता है. यह खोज, दिए गए RangeElement से शुरू होती है.
findText(searchPattern)RangeElement|nullरेगुलर एक्सप्रेशन का इस्तेमाल करके, एलिमेंट के कॉन्टेंट में दिए गए टेक्स्ट पैटर्न को खोजता है.
findText(searchPattern, from)RangeElement|nullयह फ़ंक्शन, एलिमेंट के कॉन्टेंट में दिए गए टेक्स्ट पैटर्न को खोजता है. यह खोज, दिए गए खोज नतीजे से शुरू होती है.
getAttributes()Objectयह एलिमेंट के एट्रिब्यूट वापस लाता है.
getBackgroundColor()String|nullबैकग्राउंड का रंग वापस लाता है.
getChild(childIndex)Elementयह फ़ंक्शन, दिए गए चाइल्ड इंडेक्स पर मौजूद चाइल्ड एलिमेंट को वापस लाता है.
getChildIndex(child)Integerयह फ़ंक्शन, बताए गए चाइल्ड एलिमेंट के लिए चाइल्ड इंडेक्स को वापस लाता है.
getColSpan()Integerयह कॉलम स्पैन को वापस लाता है. यह टेबल सेल के उन कॉलम की संख्या होती है जिनमें यह सेल फैली होती है.
getLinkUrl()String|nullयह कुकी, लिंक का यूआरएल वापस पाती है.
getNextSibling()Element|nullयह एलिमेंट के अगले सिबलिंग एलिमेंट को वापस लाता है.
getNumChildren()Integerइससे बच्चों की संख्या मिलती है.
getPaddingBottom()Number|nullयह बॉटम पैडिंग को पॉइंट में दिखाता है.
getPaddingLeft()Number|nullयह बाईं ओर की पैडिंग को पॉइंट में दिखाता है.
getPaddingRight()Number|nullयह दाईं ओर की पैडिंग को पॉइंट में दिखाता है.
getPaddingTop()Number|nullयह फ़ंक्शन, टॉप पैडिंग को पॉइंट में दिखाता है.
getParent()ContainerElement|nullयह एलिमेंट के पैरंट एलिमेंट को वापस लाता है.
getParentRow()TableRow|nullइस फ़ंक्शन से, मौजूदा TableCell वाला TableRow मिलता है.
getParentTable()Table|nullइस फ़ंक्शन से, मौजूदा TableCell वाला Table मिलता है.
getPreviousSibling()Element|nullयह एलिमेंट के पिछले सिबलिंग एलिमेंट को वापस लाता है.
getRowSpan()Integerयह विकल्प, लाइन स्पैन को वापस लाता है. यह टेबल सेल की उन लाइनों की संख्या होती है जिनमें यह सेल शामिल होती है.
getText()Stringयह फ़ंक्शन, एलिमेंट के कॉन्टेंट को टेक्स्ट स्ट्रिंग के तौर पर वापस लाता है.
getTextAlignment()TextAlignment|nullटेक्स्ट अलाइनमेंट की जानकारी मिलती है.
getType()ElementTypeयह एलिमेंट के ElementType को वापस लाता है.
getVerticalAlignment()VerticalAlignment|nullयह कुकी, VerticalAlignment को वापस लाती है.
getWidth()Number|nullयह फ़ंक्शन, सेल वाले कॉलम की चौड़ाई को पॉइंट में दिखाता है.
insertHorizontalRule(childIndex)HorizontalRuleयह तय किए गए इंडेक्स पर, नया HorizontalRule बनाता है और उसे डालता है.
insertImage(childIndex, image)InlineImageयह फ़ंक्शन, तय किए गए इंडेक्स पर, तय की गई इमेज के बड़े ऑब्जेक्ट से InlineImage बनाता है और उसे शामिल करता है.
insertImage(childIndex, image)InlineImageयह फ़ंक्शन, दिए गए इंडेक्स पर InlineImage को शामिल करता है.
insertListItem(childIndex, listItem)ListItemयह फ़ंक्शन, दिए गए इंडेक्स पर ListItem को शामिल करता है.
insertListItem(childIndex, text)ListItemयह तय किए गए इंडेक्स पर, नया ListItem बनाता है और उसे डालता है.
insertParagraph(childIndex, paragraph)Paragraphयह फ़ंक्शन, दिए गए इंडेक्स पर Paragraph को शामिल करता है.
insertParagraph(childIndex, text)Paragraphयह तय किए गए इंडेक्स पर, नया Paragraph बनाता है और उसे डालता है.
insertTable(childIndex)Tableयह तय किए गए इंडेक्स पर, नया Table बनाता है और उसे डालता है.
insertTable(childIndex, cells)Tableयह फ़ंक्शन, तय किए गए इंडेक्स पर, तय की गई सेल वाला नया Table बनाता है और उसे डालता है.
insertTable(childIndex, table)Tableयह फ़ंक्शन, दिए गए इंडेक्स पर Table को शामिल करता है.
isAtDocumentEnd()Booleanइससे यह तय होता है कि एलिमेंट, Document के आखिर में है या नहीं.
merge()TableCell|nullइस विकल्प का इस्तेमाल करके, एलिमेंट को उसी तरह के पिछले सिबलिंग के साथ मर्ज किया जाता है.
removeChild(child)TableCellयह फ़ंक्शन, बताए गए चाइल्ड एलिमेंट को हटाता है.
removeFromParent()TableCell|nullइस फ़ंक्शन का इस्तेमाल करके, एलिमेंट को उसके पैरंट से हटाया जा सकता है.
replaceText(searchPattern, replacement)Elementरेगुलर एक्सप्रेशन का इस्तेमाल करके, दिए गए टेक्स्ट पैटर्न की सभी जगहों पर, दिए गए रिप्लेसमेंट स्ट्रिंग को बदलता है.
setAttributes(attributes)TableCellयह एलिमेंट के एट्रिब्यूट सेट करता है.
setBackgroundColor(color)TableCellबैकग्राउंड का रंग सेट करता है.
setLinkUrl(url)TableCellयह लिंक का यूआरएल सेट करता है.
setPaddingBottom(paddingBottom)TableCellयह विकल्प, नीचे की पैडिंग को पॉइंट में सेट करता है.
setPaddingLeft(paddingLeft)TableCellयह विकल्प, बाईं ओर की पैडिंग को पॉइंट में सेट करता है.
setPaddingRight(paddingRight)TableCellइससे दाईं ओर की पैडिंग को पॉइंट में सेट किया जाता है.
setPaddingTop(paddingTop)TableCellइससे ऊपर की पैडिंग को पॉइंट में सेट किया जाता है.
setText(text)TableCellइससे कॉन्टेंट को सामान्य टेक्स्ट के तौर पर सेट किया जाता है.
setTextAlignment(textAlignment)TableCellइससे टेक्स्ट अलाइनमेंट सेट किया जाता है.
setVerticalAlignment(alignment)TableCellवर्टिकल अलाइनमेंट सेट करता है.
setWidth(width)TableCellमौजूदा सेल वाले कॉलम की चौड़ाई को पॉइंट में सेट करता है.

ज़्यादा जानकारी वाला दस्तावेज़

appendHorizontalRule()

यह एक नया HorizontalRule बनाता है और उसे जोड़ता है.

HorizontalRule को एक नए Paragraph में शामिल किया जाएगा.

वापसी का टिकट

HorizontalRule — नई हॉरिज़ॉन्टल लाइन

अनुमति देना

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

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

appendImage(image)

यह फ़ंक्शन, दी गई इमेज के बड़े बाइनरी ऑब्जेक्ट (ब्लॉब) से नया InlineImage बनाता है और उसे जोड़ता है.

InlineImage को एक नए Paragraph में शामिल किया जाएगा.

पैरामीटर

नामटाइपब्यौरा
imageBlobSourceइमेज का डेटा

वापसी का टिकट

InlineImage — नई इमेज

अनुमति देना

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

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

appendImage(image)

दिए गए InlineImage को जोड़ता है.

InlineImage को एक नए Paragraph में शामिल किया जाएगा.

पैरामीटर

नामटाइपब्यौरा
imageInlineImageइमेज का डेटा

वापसी का टिकट

InlineImage — जोड़ी गई इमेज

अनुमति देना

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

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

appendListItem(listItem)

दिए गए ListItem को जोड़ता है.

पैरामीटर

नामटाइपब्यौरा
listItemListItemजोड़ने के लिए सूची का आइटम

वापसी का टिकट

ListItem — जोड़ी गई सूची का आइटम

अनुमति देना

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

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

appendListItem(text)

यह एक नया ListItem बनाता है और उसे जोड़ता है.

पैरामीटर

नामटाइपब्यौरा
textStringटेक्स्ट कॉन्टेंट

वापसी का टिकट

ListItem — सूची में मौजूद नया आइटम

अनुमति देना

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

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

appendParagraph(paragraph)

दिए गए Paragraph को जोड़ता है.

पैरामीटर

नामटाइपब्यौरा
paragraphParagraphजोड़ने के लिए पैराग्राफ़

वापसी का टिकट

Paragraph — जोड़ा गया पैराग्राफ़

अनुमति देना

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

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

appendParagraph(text)

यह एक नया Paragraph बनाता है और उसे जोड़ता है.

पैरामीटर

नामटाइपब्यौरा
textStringटेक्स्ट कॉन्टेंट

वापसी का टिकट

Paragraph — नया पैराग्राफ़

अनुमति देना

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

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

appendTable()

यह एक नया Table बनाता है और उसे जोड़ता है.

वापसी का टिकट

Table — नई टेबल

अनुमति देना

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

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

appendTable(cells)

यह फ़ंक्शन, तय की गई सेल वाला नया Table जोड़ता है.

पैरामीटर

नामटाइपब्यौरा
cellsString[][]नई टेबल में जोड़ने के लिए, टेबल सेल का टेक्स्ट कॉन्टेंट

वापसी का टिकट

Table — जोड़ी गई टेबल

अनुमति देना

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

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

appendTable(table)

दिए गए Table को जोड़ता है.

पैरामीटर

नामटाइपब्यौरा
tableTableजोड़ी जाने वाली टेबल

वापसी का टिकट

Table — जोड़ी गई टेबल

अनुमति देना

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

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

clear()

इससे एलिमेंट का कॉन्टेंट मिट जाता है.

वापसी का टिकट

TableCell — मौजूदा एलिमेंट.


copy()

यह फ़ंक्शन, मौजूदा एलिमेंट की अलग की गई डीप कॉपी दिखाता है.

तत्व में मौजूद सभी चाइल्ड एलिमेंट भी कॉपी किए जाते हैं. नए एलिमेंट का कोई पैरंट नहीं है.

वापसी का टिकट

TableCell — नई कॉपी.

अनुमति देना

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

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

editAsText()

बदलाव करने के लिए, मौजूदा एलिमेंट का Text वर्शन मिलता है.

रिच टेक्स्ट के तौर पर एलिमेंट के कॉन्टेंट में बदलाव करने के लिए, editAsText का इस्तेमाल करें. editAsText मोड में, टेक्स्ट के अलावा अन्य एलिमेंट (जैसे कि InlineImage और HorizontalRule) को अनदेखा कर दिया जाता है.

मिटाए गए टेक्स्ट रेंज में पूरी तरह से शामिल चाइल्ड एलिमेंट को एलिमेंट से हटा दिया जाता है.

const body =
    DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();

// Insert two paragraphs separated by a paragraph containing an
// horizontal rule.
body.insertParagraph(0, 'An editAsText sample.');
body.insertHorizontalRule(0);
body.insertParagraph(0, 'An example.');

// Delete " sample.\n\n An" removing the horizontal rule in the process.
body.editAsText().deleteText(14, 25);

वापसी का टिकट

Text — मौजूदा एलिमेंट का टेक्स्ट वर्शन


findElement(elementType)

यह फ़ंक्शन, एलिमेंट के कॉन्टेंट में, तय किए गए टाइप के डिसेंडेंट को खोजता है.

पैरामीटर

नामटाइपब्यौरा
elementTypeElementTypeखोजे जाने वाले एलिमेंट का टाइप.

वापसी का टिकट

RangeElement|null — खोज के नतीजे में, खोज के एलिमेंट की जगह के बारे में जानकारी देने वाला सर्च एलिमेंट.

अनुमति देना

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

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

findElement(elementType, from)

यह फ़ंक्शन, एलिमेंट के कॉन्टेंट में दिए गए टाइप के डिसेंडेंट को खोजता है. यह खोज, दिए गए RangeElement से शुरू होती है.

const body =
    DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();

// Define the search parameters.

let searchResult = null;

// Search until the paragraph is found.
while (
    (searchResult = body.findElement(
         DocumentApp.ElementType.PARAGRAPH,
         searchResult,
         ))) {
  const par = searchResult.getElement().asParagraph();
  if (par.getHeading() === DocumentApp.ParagraphHeading.HEADING1) {
    // Found one, update and stop.
    par.setText('This is the first header.');
    break;
  }
}

पैरामीटर

नामटाइपब्यौरा
elementTypeElementTypeखोजे जाने वाले एलिमेंट का टाइप.
fromRangeElementवह खोज नतीजा जिससे खोज करनी है.

वापसी का टिकट

RangeElement|null — खोज के नतीजे में, खोज के एलिमेंट की अगली पोज़िशन के बारे में जानकारी देने वाला नतीजा.

अनुमति देना

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

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

findText(searchPattern)

रेगुलर एक्सप्रेशन का इस्तेमाल करके, एलिमेंट के कॉन्टेंट में दिए गए टेक्स्ट पैटर्न को खोजता है.

JavaScript रेगुलर एक्सप्रेशन की कुछ सुविधाओं का पूरी तरह से इस्तेमाल नहीं किया जा सकता. जैसे, कैप्चर ग्रुप और मोड मॉडिफ़ायर.

दिए गए रेगुलर एक्सप्रेशन पैटर्न का मिलान, मौजूदा एलिमेंट में मौजूद हर टेक्स्ट ब्लॉक से अलग-अलग किया जाता है.

पैरामीटर

नामटाइपब्यौरा
searchPatternStringखोजने के लिए पैटर्न

वापसी का टिकट

RangeElement|null — खोज के नतीजे में खोजे गए टेक्स्ट की पोज़िशन दिखाता है. अगर कोई मैच नहीं मिलता है, तो यह शून्य होता है

अनुमति देना

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

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

findText(searchPattern, from)

यह फ़ंक्शन, एलिमेंट के कॉन्टेंट में दिए गए टेक्स्ट पैटर्न को खोजता है. यह खोज, दिए गए खोज नतीजे से शुरू होती है.

JavaScript रेगुलर एक्सप्रेशन की कुछ सुविधाओं का पूरी तरह से इस्तेमाल नहीं किया जा सकता. जैसे, कैप्चर ग्रुप और मोड मॉडिफ़ायर.

दिए गए रेगुलर एक्सप्रेशन पैटर्न का मिलान, मौजूदा एलिमेंट में मौजूद हर टेक्स्ट ब्लॉक से अलग-अलग किया जाता है.

पैरामीटर

नामटाइपब्यौरा
searchPatternStringखोजने के लिए पैटर्न
fromRangeElementखोज के नतीजे में मौजूद वह आइटम जिससे खोज करनी है

वापसी का टिकट

RangeElement|null — खोज के नतीजे में, खोजे गए टेक्स्ट की अगली पोज़िशन दिखाता है. अगर कोई मैच नहीं मिलता है, तो यह शून्य होता है

अनुमति देना

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

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

getAttributes()

यह एलिमेंट के एट्रिब्यूट वापस लाता है.

नतीजा एक ऐसा ऑब्जेक्ट होता है जिसमें हर मान्य एलिमेंट एट्रिब्यूट के लिए एक प्रॉपर्टी होती है. इसमें हर प्रॉपर्टी का नाम, DocumentApp.Attribute इन्यूमरेशन में मौजूद किसी आइटम से मेल खाता है.

const doc = DocumentApp.getActiveDocument();
const documentTab = doc.getActiveTab().asDocumentTab();
const body = documentTab.getBody();

// Append a styled paragraph.
const par = body.appendParagraph('A bold, italicized paragraph.');
par.setBold(true);
par.setItalic(true);

// Retrieve the paragraph's attributes.
const atts = par.getAttributes();

// Log the paragraph attributes.
for (const att in atts) {
  Logger.log(`${att}:${atts[att]}`);
}

वापसी का टिकट

Object — एलिमेंट के एट्रिब्यूट.

अनुमति देना

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

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

getBackgroundColor()

बैकग्राउंड का रंग वापस लाता है.

वापसी का टिकट

String|null — बैकग्राउंड का रंग, जिसे सीएसएस नोटेशन (जैसे कि '#ffffff') में फ़ॉर्मैट किया गया है

अनुमति देना

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

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

getChild(childIndex)

यह फ़ंक्शन, दिए गए चाइल्ड इंडेक्स पर मौजूद चाइल्ड एलिमेंट को वापस लाता है.

const body =
    DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();

// Obtain the first element in the tab.
const firstChild = body.getChild(0);

// If it's a paragraph, set its contents.
if (firstChild.getType() === DocumentApp.ElementType.PARAGRAPH) {
  firstChild.asParagraph().setText('This is the first paragraph.');
}

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerजिस चाइल्ड एलिमेंट को वापस पाना है उसका इंडेक्स.

वापसी का टिकट

Element — यह बताए गए इंडेक्स पर मौजूद चाइल्ड एलिमेंट होता है.

अनुमति देना

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

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

getChildIndex(child)

यह फ़ंक्शन, बताए गए चाइल्ड एलिमेंट के लिए चाइल्ड इंडेक्स को वापस लाता है.

पैरामीटर

नामटाइपब्यौरा
childElementवह चाइल्ड एलिमेंट जिसके लिए इंडेक्स वापस पाना है.

वापसी का टिकट

Integer — बच्चे का इंडेक्स.

अनुमति देना

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

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

getColSpan()

यह कॉलम स्पैन को वापस लाता है. यह टेबल सेल के उन कॉलम की संख्या होती है जिनमें यह सेल फैली होती है. मर्ज नहीं की गई सेल का कॉलम स्पैन 1 होता है.

वापसी का टिकट

Integer — कॉलम स्पैन या ऐसी सेल के लिए 0 जिसे किसी दूसरी सेल के साथ मर्ज किया गया है

अनुमति देना

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

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

getLinkUrl()

यह कुकी, लिंक का यूआरएल वापस पाती है.

वापसी का टिकट

String|null — लिंक का यूआरएल या अगर एलिमेंट में इस एट्रिब्यूट के लिए कई वैल्यू शामिल हैं, तो null

अनुमति देना

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

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

getNextSibling()

यह एलिमेंट के अगले सिबलिंग एलिमेंट को वापस लाता है.

अगले सिबलिंग का पैरंट वही होता है जो मौजूदा एलिमेंट का होता है. साथ ही, यह मौजूदा एलिमेंट के बाद आता है.

वापसी का टिकट

Element|null — अगला सिबलिंग एलिमेंट.

अनुमति देना

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

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

getNumChildren()

इससे बच्चों की संख्या मिलती है.

const body =
    DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();

// Log the number of elements in the tab.
Logger.log(`There are ${body.getNumChildren()} elements in the tab's body.`);

वापसी का टिकट

Integer — बच्चों की संख्या.

अनुमति देना

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

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

getPaddingBottom()

यह बॉटम पैडिंग को पॉइंट में दिखाता है.

वापसी का टिकट

Number|null — सबसे नीचे की पैडिंग, पॉइंट में

अनुमति देना

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

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

getPaddingLeft()

यह बाईं ओर की पैडिंग को पॉइंट में दिखाता है.

वापसी का टिकट

Number|null — बाईं ओर की पैडिंग, पॉइंट में

अनुमति देना

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

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

getPaddingRight()

यह दाईं ओर की पैडिंग को पॉइंट में दिखाता है.

वापसी का टिकट

Number|null — दाईं ओर की पैडिंग, पॉइंट में

अनुमति देना

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

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

getPaddingTop()

यह फ़ंक्शन, टॉप पैडिंग को पॉइंट में दिखाता है.

वापसी का टिकट

Number|null — सबसे ऊपर की पैडिंग, पॉइंट में

अनुमति देना

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

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

getParent()

यह एलिमेंट के पैरंट एलिमेंट को वापस लाता है.

पैरंट एलिमेंट में मौजूदा एलिमेंट शामिल है.

वापसी का टिकट

ContainerElement|null — पैरंट एलिमेंट.

अनुमति देना

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

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

getParentRow()

इस फ़ंक्शन से, मौजूदा TableCell वाला TableRow मिलता है.

वापसी का टिकट

TableRow|null — टेबल की वह लाइन जिसमें मौजूदा सेल मौजूद है

अनुमति देना

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

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

getParentTable()

इस फ़ंक्शन से, मौजूदा TableCell वाला Table मिलता है.

वापसी का टिकट

Table|null — मौजूदा सेल वाली टेबल

अनुमति देना

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

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

getPreviousSibling()

यह एलिमेंट के पिछले सिबलिंग एलिमेंट को वापस लाता है.

पिछला सिबलिंग, मौजूदा एलिमेंट से पहले आता है और उसका पैरंट एलिमेंट भी मौजूदा एलिमेंट जैसा ही होता है.

वापसी का टिकट

Element|null — पिछला सिबलिंग एलिमेंट.

अनुमति देना

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

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

getRowSpan()

यह विकल्प, लाइन स्पैन को वापस लाता है. यह टेबल सेल की उन लाइनों की संख्या होती है जिनमें यह सेल शामिल होती है. मर्ज नहीं की गई सेल में, पंक्ति का स्पैन 1 होता है.

वापसी का टिकट

Integer — यह पंक्ति का स्पैन होता है. अगर किसी सेल को दूसरी सेल के साथ मर्ज किया गया है, तो इसके लिए 0 का इस्तेमाल किया जाता है

अनुमति देना

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

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

getText()

यह फ़ंक्शन, एलिमेंट के कॉन्टेंट को टेक्स्ट स्ट्रिंग के तौर पर वापस लाता है.

वापसी का टिकट

String — एलिमेंट का कॉन्टेंट, टेक्स्ट स्ट्रिंग के तौर पर

अनुमति देना

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

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

getTextAlignment()

टेक्स्ट अलाइनमेंट की जानकारी मिलती है. अलाइनमेंट के लिए ये विकल्प उपलब्ध हैं: DocumentApp.TextAlignment.NORMAL, DocumentApp.TextAlignment.SUBSCRIPT, और DocumentApp.TextAlignment.SUPERSCRIPT.

वापसी का टिकट

TextAlignment|null — टेक्स्ट अलाइनमेंट का टाइप या null अगर टेक्स्ट में कई तरह के टेक्स्ट अलाइनमेंट शामिल हैं या टेक्स्ट अलाइनमेंट कभी सेट नहीं किया गया है

अनुमति देना

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

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

getType()

यह एलिमेंट के ElementType को वापस लाता है.

किसी एलिमेंट के टाइप का पता लगाने के लिए, getType() का इस्तेमाल करें.

const doc = DocumentApp.getActiveDocument();
const documentTab = doc.getActiveTab().asDocumentTab();
const body = documentTab.getBody();

// Obtain the first element in the active tab's body.

const firstChild = body.getChild(0);

// Use getType() to determine the element's type.
if (firstChild.getType() === DocumentApp.ElementType.PARAGRAPH) {
  Logger.log('The first element is a paragraph.');
} else {
  Logger.log('The first element is not a paragraph.');
}

वापसी का टिकट

ElementType — एलिमेंट का टाइप.

अनुमति देना

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

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

getVerticalAlignment()

यह कुकी, VerticalAlignment को वापस लाती है.

वापसी का टिकट

VerticalAlignment|null — वर्टिकल अलाइनमेंट

अनुमति देना

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

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

getWidth()

यह फ़ंक्शन, सेल वाले कॉलम की चौड़ाई को पॉइंट में दिखाता है.

वापसी का टिकट

Number|null — कॉलम की चौड़ाई, पॉइंट में

अनुमति देना

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

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

insertHorizontalRule(childIndex)

यह तय किए गए इंडेक्स पर, नया HorizontalRule बनाता है और उसे डालता है.

हॉरिज़ॉन्टल रूल को नए Paragraph में शामिल किया जाएगा.

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerवह इंडेक्स जहां एलिमेंट को डाला जाना है

वापसी का टिकट

HorizontalRule — नई हॉरिज़ॉन्टल लाइन

अनुमति देना

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

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

insertImage(childIndex, image)

यह फ़ंक्शन, तय किए गए इंडेक्स पर, तय की गई इमेज के बड़े ऑब्जेक्ट से InlineImage बनाता है और उसे शामिल करता है.

इमेज को एक नए Paragraph में शामिल किया जाएगा.

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerवह इंडेक्स जहां एलिमेंट को डाला जाना है
imageBlobSourceइमेज का डेटा

वापसी का टिकट

InlineImage — शामिल की गई इनलाइन इमेज

अनुमति देना

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

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

insertImage(childIndex, image)

यह फ़ंक्शन, दिए गए इंडेक्स पर InlineImage को शामिल करता है.

इमेज को एक नए Paragraph में शामिल किया जाएगा.

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerवह इंडेक्स जहां एलिमेंट को डाला जाना है
imageInlineImageइमेज डालने के लिए

वापसी का टिकट

InlineImage — शामिल की गई इनलाइन इमेज

अनुमति देना

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

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

insertListItem(childIndex, listItem)

यह फ़ंक्शन, दिए गए इंडेक्स पर ListItem को शामिल करता है.

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerवह इंडेक्स जहां एलिमेंट को डाला जाना है
listItemListItemसूची में शामिल किया जाने वाला आइटम

वापसी का टिकट

ListItem — सूची में नया आइटम जोड़ा गया

अनुमति देना

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

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

insertListItem(childIndex, text)

यह तय किए गए इंडेक्स पर, नया ListItem बनाता है और उसे डालता है.

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerवह इंडेक्स जहां एलिमेंट को डाला जाना है
textStringटेक्स्ट कॉन्टेंट

वापसी का टिकट

ListItem — सूची में मौजूद नया आइटम

अनुमति देना

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

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

insertParagraph(childIndex, paragraph)

यह फ़ंक्शन, दिए गए इंडेक्स पर Paragraph को शामिल करता है.

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerवह इंडेक्स जहां एलिमेंट को डाला जाना है
paragraphParagraphवह पैराग्राफ़ जिसे डालना है

वापसी का टिकट

Paragraph — डाला गया पैराग्राफ़

अनुमति देना

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

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

insertParagraph(childIndex, text)

यह तय किए गए इंडेक्स पर, नया Paragraph बनाता है और उसे डालता है.

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerवह इंडेक्स जहां एलिमेंट को डाला जाना है
textStringटेक्स्ट कॉन्टेंट

वापसी का टिकट

Paragraph — नया पैराग्राफ़

अनुमति देना

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

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

insertTable(childIndex)

यह तय किए गए इंडेक्स पर, नया Table बनाता है और उसे डालता है.

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerवह इंडेक्स जहां एलिमेंट को डाला जाना है

वापसी का टिकट

Table — नई टेबल

अनुमति देना

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

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

insertTable(childIndex, cells)

यह फ़ंक्शन, तय किए गए इंडेक्स पर, तय की गई सेल वाला नया Table बनाता है और उसे डालता है.

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerवह इंडेक्स जहां वैल्यू को जोड़ना है
cellsString[][]नई टेबल में जोड़ने के लिए, टेबल सेल का टेक्स्ट कॉन्टेंट

वापसी का टिकट

Table — नई टेबल

अनुमति देना

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

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

insertTable(childIndex, table)

यह फ़ंक्शन, दिए गए इंडेक्स पर Table को शामिल करता है.

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerवह इंडेक्स जहां एलिमेंट को डाला जाना है
tableTableशामिल की जाने वाली टेबल

वापसी का टिकट

Table — शामिल की गई टेबल

अनुमति देना

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

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

isAtDocumentEnd()

इससे यह तय होता है कि एलिमेंट, Document के आखिर में है या नहीं.

वापसी का टिकट

Boolean — इससे पता चलता है कि एलिमेंट टैब के आखिर में है या नहीं.

अनुमति देना

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

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

merge()

इस विकल्प का इस्तेमाल करके, एलिमेंट को उसी तरह के पिछले सिबलिंग के साथ मर्ज किया जाता है.

सिर्फ़ एक ही ElementType के एलिमेंट मर्ज किए जा सकते हैं. मौजूदा एलिमेंट में मौजूद सभी चाइल्ड एलिमेंट को, पहले वाले सिबलिंग एलिमेंट में ले जाया जाता है.

मौजूदा एलिमेंट को दस्तावेज़ से हटा दिया जाता है.

const doc = DocumentApp.getActiveDocument();
const documentTab = doc.getActiveTab().asDocumentTab();
const body = documentTab.getBody();

// Example 1: Merge paragraphs
// Append two paragraphs to the document's active tab.
const par1 = body.appendParagraph('Paragraph 1.');
const par2 = body.appendParagraph('Paragraph 2.');
// Merge the newly added paragraphs into a single paragraph.
par2.merge();

// Example 2: Merge table cells
// Create a two-dimensional array containing the table's cell contents.
const cells = [
  ['Row 1, Cell 1', 'Row 1, Cell 2'],
  ['Row 2, Cell 1', 'Row 2, Cell 2'],
];
// Build a table from the array.
const table = body.appendTable(cells);
// Get the first row in the table.
const row = table.getRow(0);
// Get the two cells in this row.
const cell1 = row.getCell(0);
const cell2 = row.getCell(1);
// Merge the current cell into its preceding sibling element.
const merged = cell2.merge();

वापसी का टिकट

TableCell|null — मर्ज किया गया एलिमेंट.

अनुमति देना

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

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

removeChild(child)

यह फ़ंक्शन, बताए गए चाइल्ड एलिमेंट को हटाता है.

पैरामीटर

नामटाइपब्यौरा
childElementहटाया जाने वाला चाइल्ड एलिमेंट

वापसी का टिकट

TableCell — मौजूदा एलिमेंट

अनुमति देना

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

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

removeFromParent()

इस फ़ंक्शन का इस्तेमाल करके, एलिमेंट को उसके पैरंट से हटाया जा सकता है.

const doc = DocumentApp.getActiveDocument();
const documentTab = doc.getActiveTab().asDocumentTab();
const body = documentTab.getBody();

// Remove all images in the active tab's body.
const imgs = body.getImages();
for (let i = 0; i < imgs.length; i++) {
  imgs[i].removeFromParent();
}

वापसी का टिकट

TableCell|null — हटाया गया एलिमेंट.

अनुमति देना

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

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

replaceText(searchPattern, replacement)

रेगुलर एक्सप्रेशन का इस्तेमाल करके, दिए गए टेक्स्ट पैटर्न की सभी जगहों पर, दिए गए रिप्लेसमेंट स्ट्रिंग को बदलता है.

खोज के पैटर्न को स्ट्रिंग के तौर पर पास किया जाता है, न कि JavaScript रेगुलर एक्सप्रेशन ऑब्जेक्ट के तौर पर. इस वजह से, आपको पैटर्न में मौजूद सभी बैकस्लैश को एस्केप करना होगा.

यह तरीका, Google की RE2 रेगुलर एक्सप्रेशन लाइब्रेरी का इस्तेमाल करता है. इससे सपोर्ट किए गए सिंटैक्स सीमित हो जाते हैं.

दिए गए रेगुलर एक्सप्रेशन पैटर्न का मिलान, मौजूदा एलिमेंट में मौजूद हर टेक्स्ट ब्लॉक से अलग-अलग किया जाता है.

const body =
    DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();

// Clear the text surrounding "Apps Script", with or without text.
body.replaceText('^.*Apps ?Script.*$', 'Apps Script');

पैरामीटर

नामटाइपब्यौरा
searchPatternStringखोज के लिए रेगुलर एक्सप्रेशन पैटर्न
replacementStringबदलाव के तौर पर इस्तेमाल किया जाने वाला टेक्स्ट

वापसी का टिकट

Element — मौजूदा एलिमेंट

अनुमति देना

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

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

setAttributes(attributes)

यह एलिमेंट के एट्रिब्यूट सेट करता है.

तय किया गया एट्रिब्यूट पैरामीटर एक ऑब्जेक्ट होना चाहिए. इसमें हर प्रॉपर्टी का नाम, DocumentApp.Attribute इन्यूमरेशन में मौजूद एक आइटम होता है. साथ ही, हर प्रॉपर्टी की वैल्यू, लागू की जाने वाली नई वैल्यू होती है.

const doc = DocumentApp.getActiveDocument();
const documentTab = doc.getActiveTab().asDocumentTab();
const body = documentTab.getBody();

// Define a custom paragraph style.
const style = {};
style[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT] =
    DocumentApp.HorizontalAlignment.RIGHT;
style[DocumentApp.Attribute.FONT_FAMILY] = 'Calibri';
style[DocumentApp.Attribute.FONT_SIZE] = 18;
style[DocumentApp.Attribute.BOLD] = true;

// Append a plain paragraph.
const par = body.appendParagraph('A paragraph with custom style.');

// Apply the custom style.
par.setAttributes(style);

पैरामीटर

नामटाइपब्यौरा
attributesObjectएलिमेंट के एट्रिब्यूट.

वापसी का टिकट

TableCell — मौजूदा एलिमेंट.

अनुमति देना

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

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

setBackgroundColor(color)

बैकग्राउंड का रंग सेट करता है.

पैरामीटर

नामटाइपब्यौरा
colorStringबैकग्राउंड का रंग, सीएसएस नोटेशन (जैसे कि '#ffffff') में फ़ॉर्मैट किया गया

वापसी का टिकट

TableCell — मौजूदा एलिमेंट

अनुमति देना

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

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

setLinkUrl(url)

यह लिंक का यूआरएल सेट करता है.

पैरामीटर

नामटाइपब्यौरा
urlStringलिंक का यूआरएल

वापसी का टिकट

TableCell — मौजूदा एलिमेंट

अनुमति देना

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

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

setPaddingBottom(paddingBottom)

यह विकल्प, नीचे की पैडिंग को पॉइंट में सेट करता है.

पैरामीटर

नामटाइपब्यौरा
paddingBottomNumberसबसे नीचे की पैडिंग, पॉइंट में

वापसी का टिकट

TableCell — मौजूदा एलिमेंट

अनुमति देना

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

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

setPaddingLeft(paddingLeft)

इससे बाईं ओर की पैडिंग को पॉइंट में सेट किया जाता है.

पैरामीटर

नामटाइपब्यौरा
paddingLeftNumberबाईं ओर की पैडिंग, पॉइंट में

वापसी का टिकट

TableCell — मौजूदा एलिमेंट

अनुमति देना

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

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

setPaddingRight(paddingRight)

इससे दाईं ओर की पैडिंग को पॉइंट में सेट किया जाता है.

पैरामीटर

नामटाइपब्यौरा
paddingRightNumberयह दाईं ओर की पैडिंग है, जो पॉइंट में होती है.

वापसी का टिकट

TableCell — मौजूदा एलिमेंट.

अनुमति देना

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

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

setPaddingTop(paddingTop)

इससे ऊपर की पैडिंग को पॉइंट में सेट किया जाता है.

पैरामीटर

नामटाइपब्यौरा
paddingTopNumberसबसे ऊपर की पैडिंग (जगह), पॉइंट में

वापसी का टिकट

TableCell — मौजूदा एलिमेंट

अनुमति देना

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

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

setText(text)

इससे कॉन्टेंट को सामान्य टेक्स्ट के तौर पर सेट किया जाता है.

ध्यान दें: मौजूदा कॉन्टेंट मिटा दिया जाता है.

पैरामीटर

नामटाइपब्यौरा
textStringनया टेक्स्ट कॉन्टेंट

वापसी का टिकट

TableCell — मौजूदा एलिमेंट

अनुमति देना

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

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

setTextAlignment(textAlignment)

इससे टेक्स्ट अलाइनमेंट सेट किया जाता है. अलाइनमेंट के लिए ये विकल्प उपलब्ध हैं: DocumentApp.TextAlignment.NORMAL, DocumentApp.TextAlignment.SUBSCRIPT, और DocumentApp.TextAlignment.SUPERSCRIPT.

// Make the entire first paragraph in the active tab be superscript.
const documentTab =
    DocumentApp.getActiveDocument().getActiveTab().asDocumentTab();
const text = documentTab.getBody().getParagraphs()[0].editAsText();
text.setTextAlignment(DocumentApp.TextAlignment.SUPERSCRIPT);

पैरामीटर

नामटाइपब्यौरा
textAlignmentTextAlignmentटेक्स्ट अलाइनमेंट का टाइप

वापसी का टिकट

TableCell — मौजूदा एलिमेंट

अनुमति देना

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

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

setVerticalAlignment(alignment)

वर्टिकल अलाइनमेंट सेट करता है.

पैरामीटर

नामटाइपब्यौरा
alignmentVerticalAlignmentवर्टिकल अलाइनमेंट

वापसी का टिकट

TableCell — मौजूदा एलिमेंट

अनुमति देना

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

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

setWidth(width)

मौजूदा सेल वाले कॉलम की चौड़ाई को पॉइंट में सेट करता है.

पैरामीटर

नामटाइपब्यौरा
widthNumberकॉलम की चौड़ाई, पॉइंट में

वापसी का टिकट

TableCell — मौजूदा एलिमेंट

अनुमति देना

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

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