Class NotesPage

附註頁面

簡報中的備註頁面。

這些頁面包含簡報講義的內容,包括含有投影片演講者備忘稿的圖案。每張投影片都有對應的備註頁面。只能修改講者備忘稿形狀中的文字。

方法

方法傳回類型簡短說明
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 物件清單。
getSpeakerNotesShape()Shape取得網頁上含有演講者備忘稿的圖案。
getTables()Table[]傳回頁面上的 Table 物件清單。
getVideos()Video[]傳回頁面上的 Video 物件清單。
getWordArts()WordArt[]傳回頁面上的 WordArt 物件清單。
replaceAllText(findText, replaceText)Integer將所有符合「尋找文字」的文字例項替換為「取代文字」。
replaceAllText(findText, replaceText, matchCase)Integer將所有符合「尋找文字」的文字例項替換為「取代文字」。

內容詳盡的說明文件

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

getSpeakerNotesShape()

取得網頁上含有演講者備忘稿的圖案。

回攻員

Shape

授權

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

  • 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

replaceAllText(findText, replaceText)

將所有符合「尋找文字」的文字例項替換為「取代文字」。搜尋時不區分大小寫。

參數

名稱類型說明
findTextString要尋找的文字。
replaceTextString要用來取代相符文字的文字。

回攻員

Integer - 發生次數已變更

授權

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

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

replaceAllText(findText, replaceText, matchCase)

將所有符合「尋找文字」的文字例項替換為「取代文字」。

參數

名稱類型說明
findTextString要尋找的文字。
replaceTextString要用來取代相符文字的文字。
matchCaseBoolean如果顯示 true,搜尋時會區分大小寫;如果顯示 false,搜尋時不會區分大小寫。

回攻員

Integer - 發生次數已變更

授權

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

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