Google Apps Script is a new JavaScript enterprise technology to automate tasks across Google products. The new JavaScript cloud scripting language allow to automate repetitive business processes (e.g. expense approvals, time-sheet tracking, ticket management, order fulfillment…), link Google products with third party services (like sending custom emails and a calendar invitation to a list from MySQL database), create customer spreadsheet functions, and even build and collect user inputs through rich graphics interface and menus.

script editorFrom the Google Enterprise Blog :

Your company can create a site for employees to browse and register for training sessions and career development programs. On the page describing each training session or class, you could add a “Register Now” button, which would automatically add registrants to the class roster, add the details of the session to each participant’s Google Calendar, and email users to confirm enrollment. All of these automated actions can be driven by a script embedded in the site.

Overall you can do every simple and complex task based on data in any of your Google products. Google products supported so far are : Spreadsheets, Document list, Gmail Contacts, Finance, Calendar, Sites and Maps.

In addition to an infinite list of options and WebServices that could could be integrated using UiApp, JDBC, SOAP, XML, Languages Translator, Mail, … etc.

A Sample function (from the getting Started) onOpen() allow to add a menu entry in the Spreadsheet app which run on Open event :

 function onOpen() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var menuEntries = [ {name: "Get Stock", functionName: "getStock"}];
  ss.addMenu("Finance", menuEntries);
}

The menu entry call a function called getStock() below :

function getStock() {
  var sheet = SpreadsheetApp.getActiveSheet();

  sheet.getRange(1, 1).setValue("Symbol");
  sheet.getRange(1, 2).setValue("Name");
  sheet.getRange(1, 3).setValue("Exchange");
  sheet.getRange(1, 4).setValue("TradeTime");
  sheet.getRange(1, 5).setValue("Price");

  var row = 2;
  while (true) {
    if (!sheet.getRange(row, 2).getValue()) {
      var symbol = sheet.getRange(row, 1).getValue();
      if (!symbol) break;
      Logger.log("Updating symbol: " + symbol);
      var stockInfo = FinanceApp.getStockInfo(symbol);
      sheet.getRange(row, 2).setValue(stockInfo.name);
      sheet.getRange(row, 3).setValue(stockInfo.exchange);
      sheet.getRange(row, 4).setValue(stockInfo.tradetime);
      sheet.getRange(row, 5).setValue(stockInfo.price);
    } else {
      Logger.log("Already updated: " + symbol);
    }
    row++;    
  }
}

This function contains the code that runs when you click Finance > Get Stock. It inserts column headers in the Spreadsheet, reads the stock symbols you put in column A, retrieves information for each symbol, and puts that information into the Spreadsheet.

Many of the available features of Google Apps Script are still experimental, however the capabilities are amazingly great. Another step for Google products toward enterprise world, and it’s powered by JavaScript !

More information about Google Apps Script at http://code.google.com/googleapps/appsscript/index.html