如何将 Indentation 设置为 Google slide Shape Text

How set Indentation to Google slide Shape Text

我们正在尝试 缩进 Google 幻灯片形状 ,方法是使用 Left/Right 缩进 值Google 应用程序脚本。

function indentShape(){
  var slide = SlidesApp.getActivePresentation().getSlides()[0];
  var shape = slide.getShapes()[0];

  // shape.setIndent(Left,Right) 
  shape.setIndent(10,20)
}
  1. setIndent() 是属于 XML 脚本服务但不属于幻灯片脚本服务的方法。 https://developers.google.com/apps-script/reference/xml-service/format
  2. 幻灯片脚本具有方法 setIndentStart(indent)setIndentFirstLine(indent)setIndentEnd(indent) https://developers.google.com/apps-script/reference/slides/paragraph-style#getIndentStart().
  3. 这里有一个如何使用这些方法的例子:
    shape.getText().getParagraphStyle().setIndentStart(20)