https://github.com/oaphi/menuapp
Google Apps Script utility library for building custom menus
https://github.com/oaphi/menuapp
custom-menus google-apps-script menu utility-library
Last synced: 3 months ago
JSON representation
Google Apps Script utility library for building custom menus
- Host: GitHub
- URL: https://github.com/oaphi/menuapp
- Owner: Oaphi
- License: mit
- Created: 2020-09-11T02:32:56.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-08-26T23:04:48.000Z (almost 2 years ago)
- Last Synced: 2025-04-15T07:12:12.555Z (3 months ago)
- Topics: custom-menus, google-apps-script, menu, utility-library
- Language: TypeScript
- Homepage:
- Size: 447 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/google/clasp)
[](LICENSE)# MenuApp
MenuApp is a small library for building custom menus from JSON configuration.
```javascript
const menu = MenuApp.buildMenu({
type: MenuApp.DocTypes.DOCUMENT,
title: "My Menu",
items: [
{
title: "My Action",
action: runMyAction.name,
},
MenuApp.createActionItem("Item from function", myCallback),
{
title: "Submenu",
items: [
{
title: "My Second Action",
actions: "MyLib.doSomething",
},
MenuApp.createSeparatorItem(),
],
},
],
append: true,
});
```The library exposes two utility enums accessible via `.`:
Parent document type: `DocTypes`
| Value |
| ------------ |
| SPREADSHEET |
| PRESENTATION |
| FORM |
| DOCUMENT |Menu item type (required if adding a special items): `ItemTypes`
| Value |
| --------- |
| MENU |
| ITEM |
| SEPARATOR |# Install
> Latest library version: 19
If developing locally, add the project info to manifest file's `dependencies.libraries` list:
| Field | Required | Value |
| ----------------- | -------- | ------------------------------------------------------------------------ |
| `libraryId` | yes | `1wr0xwr-RgfP0j9acfpJy2ESd3q4oqgM2bt0mgOemhRGS-U2N1XDxRuYk` |
| `version` | yes | Library version you want to use |
| `userSymbol` | no | The library name, `MenuApp` by default |
| `developmentMode` | no | Include the library in dev mode (will use any latest _unstable_ version) |Sample JSON object to add:
```json
{
"libraryId": "1wr0xwr-RgfP0j9acfpJy2ESd3q4oqgM2bt0mgOemhRGS-U2N1XDxRuYk",
"userSymbol": "MenuApp",
"version": "19",
"developmentMode": false
}
```Otherwise, use the new online editor UI to add the library (the id is the same as in `libraryId`):
