Monday, January 27, 2014

Learning Google App Script

https://developers.google.com/apps-script/

Custom menus in Google Docs, Sheets, or Forms
https://developers.google.com/apps-script/guides/menus
Google Docs, Forms, or new Sheets Older version of Google Sheets
function onOpen() {
  var ui = DocumentApp.getUi();
  // Or FormApp or SpreadsheetApp.
  ui.createMenu('Custom Menu')
      .addItem('First item', 'menuItem1')
      .addSeparator()
      .addSubMenu(ui.createMenu('Sub-menu')
          .addItem('Second item', 'menuItem2'))
      .addToUi();
}

function menuItem1() {
  DocumentApp.getUi() // Or FormApp or SpreadsheetApp.
     .alert('You clicked the first menu item!');
}

https://developers.google.com/apps-script/quickstart/macros

No comments:

Post a Comment