1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Googleスライドに階層構造の箇条書きリストを追加するGoogle Apps Script

Last updated at Posted at 2025-08-05

こちらの記事を参考にして、階層構造の(ネストされた)箇条書きリストを追加することができました👏

箇条書きにするにはテキストを改行(\n)で区切りますが、
階層を作るには、タブ(\t)を重ねます。

GoogleスライドのApps Scriptで以下を実行すると、

  • Lv1 はじめに
    • Lv2 次に
      • Lv3 その次に

というテキストボックスを追加します。

コード.gs
const presentation = SlidesApp.getActivePresentation();
const slides = presentation.getSlides();
const shape = slides[0].insertShape(SlidesApp.ShapeType.TEXT_BOX,50,100,300,150); //shapeType, left, top, width, height(pt)
  
const textbox = shape.getText();
textbox.setText('Lv1 はじめに\n\tLv2 次に\n\t\tLv3 その次に');
textbox.getListStyle().applyListPreset(SlidesApp.ListPreset.DISC_CIRCLE_SQUARE); //listPreset
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?