LANG SELRCT

Apps Script Reference  (Create: Create new Spreadsheet | Create new Apps Script

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ドライブのファイルを指定フォルダに移動したい - Move a file to a specific folder in Google Drive via Apps Script

Googleドライブのファイル移動を簡単にしたくて書いたコードです。 I wrote this code to make it easier to move files in Google Drive. 移動したいファイルURLと移動先のフォルダURLを入力して移動するWebアプ...