Skip to content

Instantly share code, notes, and snippets.

@UskeS
Created August 23, 2018 02:09
Show Gist options
  • Save UskeS/deae6892ee0953012d6d9c05003aa528 to your computer and use it in GitHub Desktop.
Save UskeS/deae6892ee0953012d6d9c05003aa528 to your computer and use it in GitHub Desktop.
[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.setIndentFirstLine(0);
cv.setText(" "+cv.getText());
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment