3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Google Apps ScriptをVSCodeで編集する

Posted at

事前準備

  • Node.jsがまだインストールされていない場合は、インストールしてください。
  • VSCodeを入手してください。

Google Apps Script APIをオンにする

下記にアクセスしてオンにする
https://script.google.com/home/usersettings

GAS-API.png

claspのインストール

ターミナルで以下のコマンドを実行。ターミナルの再起動が必要?

npm install -g @google/clasp

Googleアカウントでclaspにログイン

次のコマンドを実行して、Googleアカウントでclaspにログインします。

clasp login

ブラウザが開き、Googleアカウントでのログインを求められます。

GASプロジェクトのクローン

  • 既存のプロジェクトを編集する場合は、プロジェクトのスクリプトIDを使用してクローンします。
  • スクリプトIDは、Apps Scriptエディタの「プロジェクト設定」から確認できます。
clasp clone {スクリプトID}

VSCodeで編集

claspを使用してローカルにダウンロードしたスクリプトファイルをVSCodeで開いて編集します。

変更のプッシュ

スクリプトに加えた変更をGoogle Apps Scriptに反映させるには、以下のコマンドを使用します。

clasp push
3
3
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
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?