編集可能な Presentations
を作成して開きます。
// Open a presentation by ID. var preso = SlidesApp.openById('PRESENTATION_ID_GOES_HERE'); // Create and open a presentation. preso = SlidesApp.create('Presentation Name');
Properties
プロパティ | 種類 | 説明 |
---|---|---|
AlignmentPosition | AlignmentPosition | アライメント位置のタイプの列挙型。 |
ArrowStyle | ArrowStyle | Line に指定できる、さまざまな矢印スタイルの列挙型。 |
AutoTextType | AutoTextType | 自動テキスト型の列挙型。 |
AutofitType | AutofitType | 自動調整タイプの列挙型。 |
CellMergeState | CellMergeState | テーブルセルのさまざまなマージ状態の列挙型。 |
ColorType | ColorType | 色の型の列挙型。 |
ContentAlignment | ContentAlignment | コンテンツの配置を指定するために使用される値の列挙型です。 |
DashStyle | DashStyle | Line に使用できるさまざまなダッシュ スタイルの列挙型。 |
FillType | FillType | 広告掲載タイプの列挙型。 |
LineCategory | LineCategory | Line のカテゴリの列挙型。 |
LineFillType | LineFillType | LineFill 型の列挙型。 |
LineType | LineType | Line 型の列挙型。 |
LinkType | LinkType | リンクの種類の列挙。 |
ListPreset | ListPreset | リスト プリセットの種類の列挙型。 |
PageBackgroundType | PageBackgroundType | ページの背景の種類を列挙します。 |
PageElementType | PageElementType | ページ要素の種類を列挙します。 |
PageType | PageType | ページの種類を列挙したものです。 |
ParagraphAlignment | ParagraphAlignment | 段落の配置の型の列挙。 |
PlaceholderType | PlaceholderType | プレースホルダの種類の列挙。 |
PredefinedLayout | PredefinedLayout | 事前定義されたレイアウトの列挙型。 |
SelectionType | SelectionType | 選択タイプの列挙型。 |
ShapeType | ShapeType | シェイプのタイプの列挙型。 |
SheetsChartEmbedType | SheetsChartEmbedType | スプレッドシート グラフの埋め込みタイプの列挙型。 |
SlideLinkingMode | SlideLinkingMode | スライドのリンク方法の列挙型。 |
SlidePosition | SlidePosition | スライド位置のタイプの列挙型。 |
SpacingMode | SpacingMode | 間隔モードのタイプの列挙型。 |
TextBaselineOffset | TextBaselineOffset | テキスト ベースライン オフセットの型の列挙型。 |
TextDirection | TextDirection | テキスト方向のタイプの列挙型。 |
ThemeColorType | ThemeColorType | テーマ色の列挙型。 |
VideoSourceType | VideoSourceType | 動画ソースの種類の列挙です。 |
Methods
方法 | 戻り値の型 | 概要 |
---|---|---|
create(name) | Presentation | 新しい Presentation を作成して開きます。 |
getActivePresentation() | Presentation | スクリプトがコンテナにバインドされている現在アクティブなプレゼンテーションを返します。アクティブなプレゼンテーションがない場合は null を返します。 |
getUi() | Ui | スクリプトがメニュー、ダイアログ、サイドバーなどの機能を追加できるようにするための、プレゼンテーションのユーザー インターフェース環境のインスタンスを返します。 |
newAffineTransformBuilder() | AffineTransformBuilder | 新しい AffineTransformBuilder を返して AffineTransform をビルドします。 |
openById(id) | Presentation | 指定された ID の Presentation を開きます。 |
openByUrl(url) | Presentation | 指定された URL の Presentation を開きます。 |
詳細なドキュメント
create(name)
新しい Presentation
を作成して開きます。
パラメータ
名前 | 型 | 説明 |
---|---|---|
name | String | 作成したプレゼンテーションに付ける名前。 |
戻る
Presentation
- 指定した名前のプレゼンテーション。
認可
このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。
-
https://www.googleapis.com/auth/presentations
getActivePresentation()
スクリプトがコンテナにバインドされている現在アクティブなプレゼンテーションを返します。アクティブなプレゼンテーションがない場合は null
を返します。スクリプトがコンテナにバインドされていないプレゼンテーションを操作するには、代わりに openById(id)
を使用します。
// Get the current presentation to which this script is bound. var presentation = SlidesApp.getActivePresentation();すでに共有されているプレゼンテーションがある場合は、同じプレゼンテーション インスタンスが返されます。
戻る
認可
このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
getUi()
スクリプトがメニュー、ダイアログ、サイドバーなどの機能を追加できるようにするための、プレゼンテーションのユーザー インターフェース環境のインスタンスを返します。スクリプトが操作できるのは、開いているプレゼンテーションの現在のインスタンスの UI で、スクリプトがプレゼンテーションにバインドされている場合のみです。詳しくは、メニューおよびダイアログとサイドバーに関するガイドをご覧ください。
// Add a custom menu to the active presentation, including a separator and a sub-menu. function onOpen(e) { SlidesApp.getUi() .createMenu('My Menu') .addItem('My menu item', 'myFunction') .addSeparator() .addSubMenu(SlidesApp.getUi().createMenu('My sub-menu') .addItem('One sub-menu item', 'mySecondFunction') .addItem('Another sub-menu item', 'myThirdFunction')) .addToUi(); }
戻る
newAffineTransformBuilder()
新しい AffineTransformBuilder
を返して AffineTransform
をビルドします。ビルダーには ID アフィン変換が事前に設定されています。
戻る
openById(id)
指定された ID の Presentation
を開きます。
// Open a presentation by ID. var presentation = SlidesApp.openById('docId');すでに共有されているプレゼンテーションがある場合は、同じプレゼンテーション インスタンスが返されます。
パラメータ
名前 | 型 | 説明 |
---|---|---|
id | String |
戻る
Presentation
- 指定された ID のプレゼンテーション
認可
このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。
-
https://www.googleapis.com/auth/presentations
openByUrl(url)
指定された URL の Presentation
を開きます。
// Open a presentation by URL. var presentation = SlidesApp.openByUrl('https://docs.google.com/presentation/d/docId/edit');すでに共有されているプレゼンテーションがある場合は、同じプレゼンテーション インスタンスが返されます。
パラメータ
名前 | 型 | 説明 |
---|---|---|
url | String |
戻る
Presentation
- 指定された URL のプレゼンテーション
認可
このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。
-
https://www.googleapis.com/auth/presentations