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ドライブ内の音声ファイルをiframe内で再生したい

iframe の src にGoogleドライブ内の音声ファイルを埋め込む例です (今回試した音声ファイルはmp3) Code.gs function doGet () { return HtmlService . createTemplateFromFile ( ...