Install
marcelo.valvassori / GAS Status Code Toolbar

Published:

Version: 1.0.1+daa5828 updated

Summary: Google App Script Editor - Saves dropdown state of code blocks and more...

Groups:

Homepage: https://github.com/bitts/GAS-Status-Code-Toolbar

Support: https://github.com/bitts/GAS-Status-Code-Toolbar/issues

Copyright: 2025, Bitts [github.com/bitts](mbitts.com)

License: MIT; https://opensource.org/licenses/MIT

Antifeature: unspecified

In OpenUserJS click Source Code > Raw Source or in button Install and Tampermonkey will prompt installation.

Confirm and enable it.


๐Ÿš€ Usage

  1. Open any project in the Google Apps Script Editor:
    https://script.google.com/

  2. The toolbar will load automatically.

  3. Use it to:

    • ๐Ÿ’พ Save code snippets
    • ๐Ÿ“‚ Reuse saved blocks
    • โš™๏ธ Configure shortcut keys

โš™๏ธ Technical Overview

The modern Google Apps Script Editor is built on top of the Monaco Editor, the same open-source editor that powers Visual Studio Code:

๐Ÿ”— https://github.com/microsoft/monaco-editor

Monaco provides:

  • Syntax highlighting
  • IntelliSense
  • Smart autocomplete
  • Code diagnostics
  • Advanced text model handling

The GAS-Status-Code-Toolbar leverages this architecture to extend the editor interface.

๐Ÿ” How the Script Interacts with Monaco

The userscript:

  • Detects when script.google.com loads
  • Waits for Monaco to initialize in the DOM
  • Injects custom HTML toolbar elements
  • Hooks into keyboard events
  • Interacts with the active editor instance to:
    • Capture selected code
    • Insert snippets at the cursor position
    • Programmatically modify the text model

Because Monaco exposes its editor instance in the page context, the script can safely access the active model (editor.getModel()) and apply controlled edits.

๐Ÿง  Execution Flow

  1. Browser loads the Google Apps Script Editor.
  2. Monaco Editor initializes.
  3. Tampermonkey executes GAS-Status-Code-Toolbar.
  4. The toolbar is injected into the interface.
  5. Keyboard events are captured.
  6. Text modifications are applied directly to Monacoโ€™s model.

Important:

The script does not modify the Google Apps Script runtime.
It operates strictly at the browser UI layer, extending Monacoโ€™s behavior.

This makes the solution safe, non-invasive, and fully reversible (simply disable the script in Tampermonkey).


๐Ÿ“ท Visual Demo

Example toolbar interface reference:
Toolbar

(Illustrative images for UI context.)


๐Ÿ’ก Innovation

The project:

  • ๐Ÿš€ Boosts development productivity
  • ๐Ÿ“‚ Introduces built-in snippet management
  • โŒจ๏ธ Enables shortcut-driven workflow
  • ๐Ÿงฉ Extends functionality without official API changes

๐Ÿ”ฎ Future Possibilities

  • Cloud snippet synchronization
  • Import/export settings
  • GitHub Gist integration
  • Advanced logging interface
  • Compatibility with other Monaco-based editors

๐Ÿ›  Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a branch
  3. Submit a Pull Request

๐Ÿ“„ License

Released under the GPL-3.0 License.

Rating: 0