Class NotesMaster

注意事項主機

簡報中的備忘稿母片。

備忘稿母片會定義所有備忘稿頁面的預設文字樣式和頁面元素。附註母片為唯讀。

方法

方法傳回類型簡短說明
getGroups()Group[]傳回頁面上的 Group 物件清單。
getImages()Image[]傳回頁面上的 Image 物件清單。
getLines()Line[]傳回頁面上的 Line 物件清單。
getObjectId()String取得網頁的專屬 ID。
getPageElementById(id)PageElement|null傳回具有指定 ID 的頁面上的 PageElement,如果沒有則傳回 null
getPageElements()PageElement[]傳回頁面上顯示的 PageElement 物件清單。
getPlaceholder(placeholderType)PageElement|null傳回指定 PlaceholderType 的預留位置 PageElement 物件,或如果沒有相符的預留位置,則傳回 null
getPlaceholder(placeholderType, placeholderIndex)PageElement|null傳回指定 PlaceholderType 和預留位置索引的預留位置 PageElement 物件,如果沒有預留位置,則傳回 null
getPlaceholders()PageElement[]傳回頁面中的預留位置 PageElement 物件清單。
getShapes()Shape[]傳回頁面上的 Shape 物件清單。
getSheetsCharts()SheetsChart[]傳回頁面上的 SheetsChart 物件清單。
getTables()Table[]傳回頁面上的 Table 物件清單。
getVideos()Video[]傳回頁面上的 Video 物件清單。
getWordArts()WordArt[]傳回頁面上的 WordArt 物件清單。

內容詳盡的說明文件

getGroups()

傳回頁面上的 Group 物件清單。

回攻員

Group[]

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

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

getImages()

傳回頁面上的 Image 物件清單。

回攻員

Image[]

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

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

getLines()

傳回頁面上的 Line 物件清單。

回攻員

Line[]

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

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

getObjectId()

取得網頁的專屬 ID。網頁和網頁元素使用的物件 ID 共用相同的命名空間。

回攻員

String

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

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

getPageElementById(id)

傳回具有指定 ID 的頁面上的 PageElement,如果沒有則傳回 null

參數

名稱類型說明
idString要擷取的網頁元素 ID。

回攻員

PageElement|null:具有指定 ID 的頁面元素。

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

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

getPageElements()

傳回頁面上顯示的 PageElement 物件清單。

回攻員

PageElement[]

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

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

getPlaceholder(placeholderType)

傳回指定 PlaceholderType 的預留位置 PageElement 物件,或如果沒有相符的預留位置,則傳回 null

如果有多個相同類型的預留位置,系統會傳回預留位置索引最小的預留位置。如果有多個相符的預留位置具有相同索引,系統會從網頁的網頁元素集合傳回第一個預留位置。

const slide = SlidesApp.getActivePresentation().getSlides()[0];
const placeholder = slide.getPlaceholder(
    SlidesApp.PlaceholderType.CENTERED_TITLE,
);

參數

名稱類型說明
placeholderTypePlaceholderType

回攻員

PageElement|null

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

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

getPlaceholder(placeholderType, placeholderIndex)

傳回指定 PlaceholderType 和預留位置索引的預留位置 PageElement 物件,如果沒有預留位置,則傳回 null

如果有多個相同類型和索引的預留位置,系統會從網頁的網頁元素集合傳回第一個預留位置。

const slide = SlidesApp.getActivePresentation().getSlides()[0];
const placeholder = slide.getPlaceholder(
    SlidesApp.PlaceholderType.CENTERED_TITLE,
    0,
);

參數

名稱類型說明
placeholderTypePlaceholderType
placeholderIndexInteger

回攻員

PageElement|null

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

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

getPlaceholders()

傳回頁面中的預留位置 PageElement 物件清單。

const master = SlidesApp.getActivePresentation().getMasters()[0];
Logger.log(
    `Number of placeholders in the master: ${master.getPlaceholders().length}`,
);

回攻員

PageElement[]

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

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

getShapes()

傳回頁面上的 Shape 物件清單。

回攻員

Shape[]

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

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

getSheetsCharts()

傳回頁面上的 SheetsChart 物件清單。

回攻員

SheetsChart[]

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

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

getTables()

傳回頁面上的 Table 物件清單。

回攻員

Table[]

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

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

getVideos()

傳回頁面上的 Video 物件清單。

回攻員

Video[]

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

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

getWordArts()

傳回頁面上的 WordArt 物件清單。

回攻員

WordArt[]

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

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