Class NotesPage

NotesPage

簡報中的備忘稿頁面。

這些網頁包含簡報講義的內容,包括一個包含投影片演講者備忘稿的形狀。每張投影片都有相應的筆記頁面。只能修改講者附註形狀中的文字。

方法

方法傳回類型簡短說明
getGroups()Group[]傳回頁面上的 Group 物件清單。
getImages()Image[]傳回頁面上的 Image 物件清單。
getLines()Line[]傳回頁面上的 Line 物件清單。
getObjectId()String取得網頁的專屬 ID。
getPageElementById(id)PageElement傳回網頁上有指定 ID 的 PageElement,如果不存在,則傳回 null
getPageElements()PageElement[]傳回已在網頁上算繪的 PageElement 物件清單。
getPlaceholder(placeholderType)PageElement傳回指定 PlaceholderType 的預留位置 PageElement 物件;如果沒有相符的預留位置,則傳回 null
getPlaceholder(placeholderType, placeholderIndex)PageElement傳回指定 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:具有指定 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

如果有多個相同類型的預留位置,則會傳回具有最低預留位置索引數量的預留位置。如果多個相符預留位置都具備相同索引,則會傳回網頁元素集合中的第一個預留位置。

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

參數

名稱類型說明
placeholderTypePlaceholderType

回攻員

PageElement

授權

使用這個方法的指令碼必須取得以下一或多個範圍的授權:

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

getPlaceholder(placeholderType, placeholderIndex)

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

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

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

參數

名稱類型說明
placeholderTypePlaceholderType
placeholderIndexInteger

回攻員

PageElement

授權

使用這個方法的指令碼必須取得以下一或多個範圍的授權:

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

getPlaceholders()

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

var 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