Kullanıcının etkin sunudaki seçimi.
const selection = SlidesApp.getActivePresentation().getSelection(); const currentPage = selection.getCurrentPage(); const selectionType = selection.getSelectionType();
Yöntemler
| Yöntem | Dönüş türü | Kısa açıklama | 
|---|---|---|
| get | Page | Etkin sayfa yoksa şu anda etkin olan Pageveyanulldeğerini döndürür. | 
| get | Page | Seçilen Pageörneklerini içerenPagekoleksiyonunu veya seçiliPageörneği yoksanulldeğerini döndürür. | 
| get | Page | Film şeridinde seçili olan Pageörneklerini içerenPagekoleksiyonunu veya seçimSelectiontüründe değilsenulldeğerini döndürür. | 
| get | Selection | Selectiondeğerini döndürür. | 
| get | Table | Seçilen TableörnekleriTablekoleksiyonunu veya seçiliTableörneği yoksanulldeğerini döndürür. | 
| get | Text | Seçili Textdeğerini veya seçimSelectiontüründe değilsenulldeğerini döndürür. | 
Ayrıntılı dokümanlar
get
Etkin sayfa yoksa şu anda etkin olan Page veya null değerini döndürür.
const selection = SlidesApp.getActivePresentation().getSelection(); const currentPage = selection.getCurrentPage(); if (currentPage != null) { Logger.log(`Selected current active page ID: ${currentPage.getObjectId()}`); }
Return
Yetkilendirme
Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
- 
https://www.googleapis.com/auth/presentations.currentonly
- 
https://www.googleapis.com/auth/presentations
get
Seçilen Page örneklerini içeren Page koleksiyonunu veya seçili Page örneği yoksa null değerini döndürür.
const selection = SlidesApp.getActivePresentation().getSelection(); const selectionType = selection.getSelectionType(); if (selectionType === SlidesApp.SelectionType.PAGE_ELEMENT) { const currentPage = selection.getCurrentPage(); const pageElements = selection.getPageElementRange().getPageElements(); Logger.log(`Number of page elements selected: ${pageElements.length}`); }
Return
Yetkilendirme
Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
- 
https://www.googleapis.com/auth/presentations.currentonly
- 
https://www.googleapis.com/auth/presentations
get
Film şeridinde seçili olan Page örneklerini içeren Page koleksiyonunu veya seçim Selection türünde değilse null değerini döndürür.
const selection = SlidesApp.getActivePresentation().getSelection(); const selectionType = selection.getSelectionType(); if (selectionType === SlidesApp.SelectionType.PAGE) { const pageRange = selection.getPageRange(); Logger.log( `Number of pages in the flimstrip selected: ${ pageRange.getPages().length}`, ); }
Return
Yetkilendirme
Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
- 
https://www.googleapis.com/auth/presentations.currentonly
- 
https://www.googleapis.com/auth/presentations
get
Selection değerini döndürür.
const selection = SlidesApp.getActivePresentation().getSelection(); const selectionType = selection.getSelectionType(); if (selectionType === SlidesApp.SelectionType.CURRENT_PAGE) { const currentPage = selection.getCurrentPage(); Logger.log(`Selected current active page ID: ${currentPage.getObjectId()}`); }
Return
Yetkilendirme
Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
- 
https://www.googleapis.com/auth/presentations.currentonly
- 
https://www.googleapis.com/auth/presentations
get
Seçilen Table örnekleri Table koleksiyonunu veya seçili Table örneği yoksa null değerini döndürür.
const selection = SlidesApp.getActivePresentation().getSelection(); const selectionType = selection.getSelectionType(); if (selectionType === SlidesApp.SelectionType.TABLE_CELL) { const currentPage = selection.getCurrentPage(); const tableCells = selection.getTableCellRange().getTableCells(); const table = tableCells[0].getParentTable(); Logger.log(`Number of table cells selected: ${tableCells.length}`); }
Return
Yetkilendirme
Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
- 
https://www.googleapis.com/auth/presentations.currentonly
- 
https://www.googleapis.com/auth/presentations
get
Seçili Text değerini veya seçim Selection türünde değilse null değerini döndürür.
Text iki senaryoyu temsil eder:
1. Seçilen metin aralığı. Örneğin, bir şekilde "Merhaba" metni varsa ve "O" seçilirse döndürülen aralık Text = 0 ve Text = 2 değerini alır.
2. İmleç konumu. Örneğin, bir şekilde "Merhaba" metni varsa ve imleç "H"den sonraysa ("H|ello"), döndürülen aralık Text = 1 ve Text = 1 değerini içerir.
const selection = SlidesApp.getActivePresentation().getSelection(); const selectionType = selection.getSelectionType(); if (selectionType === SlidesApp.SelectionType.TEXT) { const currentPage = selection.getCurrentPage(); const pageElement = selection.getPageElementRange().getPageElements()[0]; const textRange = selection.getTextRange(); Logger.log(`Text selected: ${textRange.asString()}`); }
Return
Yetkilendirme
Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
- 
https://www.googleapis.com/auth/presentations.currentonly
- 
https://www.googleapis.com/auth/presentations