Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
[Google Document] [GAS] 先頭行インデントがある行に全角スペースを追加する
function insertInitSpace() {
var doc = DocumentApp.getActiveDocument();
var paras = doc.getBody().getParagraphs();
paras.forEach(function (cv) {
var fl = cv.getIndentFirstLine();
if (fl > 0) {
cv.setText(" "+cv.getText());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment