Class Footnote

Altbilgi

Dipnotu temsil eden bir öğe. Her Footnote, bir ListItem veya Paragraph içinde yer alır ve dipnotun içeriği için karşılık gelen bir FootnoteSection öğesine sahiptir. Footnote öğesi başka bir öğe içeremez. Belge yapısı hakkında daha fazla bilgi için Google Dokümanlar'ı genişletme kılavuzuna bakın.

Yöntemler

YöntemDönüş türüKısa açıklama
copy()FootnoteGeçerli öğenin ayrılmış, derin bir kopyasını döndürür.
getAttributes()ObjectÖğenin özelliklerini alır.
getFootnoteContents()FootnoteSection|nullDipnot öğesinin içeriğini alır.
getNextSibling()Element|nullÖğenin sonraki kardeş öğesini alır.
getParent()ContainerElement|nullÖğenin üst öğesini alır.
getPreviousSibling()Element|nullÖğenin önceki kardeş öğesini alır.
getType()ElementTypeÖğenin ElementType değerini alır.
isAtDocumentEnd()BooleanÖğenin Document sonunda olup olmadığını belirler.
removeFromParent()Footnote|nullÖğeyi üst öğesinden kaldırır.
setAttributes(attributes)FootnoteÖğenin özelliklerini ayarlar.

Ayrıntılı belgeler

copy()

Geçerli öğenin ayrılmış, derin bir kopyasını döndürür.

Öğede bulunan tüm alt öğeler de kopyalanır. Yeni öğenin üst öğesi yok.

Return

Footnote: Yeni kopya.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

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

getAttributes()

Öğenin özelliklerini alır.

Sonuç, her geçerli öğe özelliği için bir özellik içeren bir nesnedir. Her özellik adı, DocumentApp.Attribute numaralandırmasındaki bir öğeye karşılık gelir.

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]}`);
}

Return

Object: Öğenin özellikleri.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

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

getFootnoteContents()

Dipnot öğesinin içeriğini alır.

Return

FootnoteSection|null: Dipnot bölümü

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

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

getNextSibling()

Öğenin sonraki kardeş öğesini alır.

Bir sonraki kardeş öğe, aynı üst öğeye sahiptir ve geçerli öğeyi takip eder.

Return

Element|null: Sonraki kardeş öğe.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

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

getParent()

Öğenin üst öğesini alır.

Üst öğe, geçerli öğeyi içerir.

Return

ContainerElement|null: Üst öğe.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

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

getPreviousSibling()

Öğenin önceki kardeş öğesini alır.

Önceki kardeş öğe, aynı üst öğeye sahiptir ve geçerli öğeden önce gelir.

Return

Element|null: Önceki kardeş öğe.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

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

getType()

Öğenin ElementType değerini alır.

Belirli bir öğenin tam türünü belirlemek için getType() kullanın.

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.');
}

Return

ElementType: Öğe türü.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

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

isAtDocumentEnd()

Öğenin Document sonunda olup olmadığını belirler.

Return

Boolean: Öğenin sekmenin sonunda olup olmadığı.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

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

removeFromParent()

Öğeyi üst öğesinden kaldırır.

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();
}

Return

Footnote|null: Kaldırılan öğe.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

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

setAttributes(attributes)

Öğenin özelliklerini ayarlar.

Belirtilen özellikler parametresi, her özellik adının DocumentApp.Attribute numaralandırmasındaki bir öğe ve her özellik değerinin uygulanacak yeni değer olduğu bir nesne olmalıdır.

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);

Parametreler

AdTürAçıklama
attributesObjectÖğenin özellikleri.

Return

Footnote: Geçerli öğe.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

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