Giter Site home page Giter Site logo

mshcruz / gas-terminal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from inclu-cat/gas-terminal

0.0 1.0 0.0 92 KB

A spreadsheet that can easily execute functions (called commands) created with Google apps script.

License: Other

TypeScript 100.00%

gas-terminal's Introduction

GAS-Terminal

A spreadsheet that can easily execute functions (called commands) created with Google Apps Script. It also supports long-running scripts.

The original spreadsheet is here.

Related article is here.

And an article about long-running support is here.

image

What is this?

This spreadsheet will help you in the following ways.

  • it makes your functions manageable and easy to understand.
  • it allows you to modify execution parameters and to run the functions easily.
  • it allows you to check the execution result log easily.

How to use

1. Copy the original spreadsheet (only once).

Open this spreadsheat, click [File]-[Make a copy], and save it to your Google Drive with a name of your choice. (You must be signed in with a Google account.)

image

2. Open the Script editor

Open the new spreadsheet, click [Tools]-[Script editor].

image

3. Write your code.

In the Script editor, you can write any function you need. You can write it in any source file you like (or in a new file, of course), but do not edit the group of files starting with gas-terminal.

image

Tips

  • To output the log to the result area, use the LogUtils class.
  • A function can have up to five arguments. (All parameters are of type string)
  • If you want to implement a function that runs for a long time, use the LongRun class. (See the bottom of this README)

4. Write the definition of the command

In the Commands sheet, write the command definition that corresponds to the function you wrote.

image

5. Execute the command

In the Terminal sheet, select the command, input parameters, then click the Execute button.

image

6. Authorize the script to run (only once)

The first time you run it, you will see a dialog asking for permission to run the script. Follow the steps below to allow the script to run.

  • Click Continue image

  • Select your account (Perhaps it will be a different procedure for signing in.) image

  • Click Advanced. image

  • Click Go to GAS-Terminal (unsafe). image

  • Click Allow. image

  • Then click Execute button again.

    Don't worry about the word "unsafe". It's a dialog that all of us face when running our personal scripts.๐Ÿ‘

7. Click Yes and check the result (as shown at the top of this page).

image

If you want to modify this tool by using clasp and TypeScript

  1. Follow the instructions above to copy the original spreadsheet.
  2. Open the Script editor, click Project Settings, copy the Script ID. (We'll use it later)
  3. If you have not installed clasp yet, install clasp, following the official page.
  4. Do the command clasp login, and login with your account. (If you have not done yet)
  5. Clone this repository, and open the cloned project with your IDE.
  6. Open .clasp.json, and replace the scriptId with your Script ID copied above.
  7. You can make any changes you like to the cloned code.
  8. Then do the command clasp push, and it will replace your copied spreadsheet's Apps Script with your code.

Support for long-running scripts

Google Apps Script has the 6 minute execution time limit. This problem is very tricky. You can solve this problem by using the GAS-Terminal's class LongRun. Please see the sample function named LongRunTest in Code.ts. You also can run the sample command by select the command named Long-Running Test (Sample) and can execute it.

gas-terminal's People

Contributors

inclu-cat avatar makoto-ishibashi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.