0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GAS(Google Apps Script)とは何か?始め方は?

Posted at

はじめに

友人の依頼でスプレッドシートに記入している売上を月別で集計するツールを作ることになった。
その際、VBAのようなものが無いか調べたところ、Google Apps Scriptというスクリプトを作成する環境を始めて知ったため知識をまとめる。

GASとは?

Googleが提供しているクラウドベースのスクリプト環境のこと。

Googleサービス(Gmail、Googleスプレッドシート、Googleドキュメント、Googleカレンダーなど)を自動化・拡張出来るツールである。

JavaScriptベースで記載されている。

【利用例】

  • Gmail:メール送信や整理の自動化
  • Googleスプレッドシート:データ集計・計算

GASの始め方

Googleスプレッドシートでの始め方を記載します。

①Apps Scriptを開く
[ 拡張機能 ] → [ Apps Script ]を開けます。

image.png

②JavaScriptでコードを記載が可能
image.png

便利に感じたこと

  • 面倒な環境構築が不要
  • 時間トリガーなどで毎日・毎週といった定期実行が可能
  • クラウドベースなので、どの端末からでもアクセスして起動可能
  • HTMLも埋め込むことが出来る(個人的にはスクリプト実行中のローディング画面を作成して実行中ということが分かるようにしました。)
<!DOCTYPE html>
<html>
  <body>
    <div style="text-align:center; font-size:16px;">
      <p>処理中です。しばらくお待ちください...</p>
      <img src="https://www.google.com/images/spin-32.gif">
    </div>
  </body>
</html>

↓実行結果
image.png

今後について

依頼の集計ツールは出来たので一旦完了だが、今後はスプレッドシートだけではなくGmailやGoogleドキュメントなどもGASを用いて効率化してみたいと思う。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?