Apps Scriptリファレンス: Apps Script Reference |障害・課題追跡: IssueTracker |Google Workspace: Status Dashboard - Summary

2022年11月3日木曜日

Googleドキュメントのテキストの色を一括で変えたい


下記コード.gsの ID を変えて myFunction() を実行すると、ドキュメントのテキストの色を #d3d3d3 に変更できました。



コード.gs
function myFunction() {
  var url = "https://docs.google.com/document/d/ID/edit";
  var doc = DocumentApp.openByUrl(url);
  doc.editAsText().setForegroundColor('#d3d3d3');
}


参考

editAsText()

setForegroundColor(foregroundColor)

Latest post

Google Formsで複数の質問と選択肢の順番を毎回シャッフルしたい(Apps Script)

質問や選択肢をシャッフルする方法ついては以下のリンク先に書きました Google Formsで質問の順番をシャッフルしたい(setShuffleQuestions) Google Formsで選択肢の順番を毎回シャッフルしたい(UI設定のみ) Google Formsで選択肢の順...