Friday, June 19, 2009

Sample Custom Function: Convert()

The URL Fetch service can be quite useful to create custom functions out of simple capabilities on other websites. Here's a sample custom function I wrote which will convert practically anything by using the conversion capability of Google Search in the background. So, for example:
=convert(100, "feet", "meters")
or
=convert(52, "weeks", "hours")
or
=convert(3, "tsp", "tbsp") (that's teaspoons to tablespoons!)

Those all work... as do many (many!) others...

The sample spreadsheet is here:
http://spreadsheets.google.com/ccc?key=r7PRNG-DcO3Qk33l8cVgYCQ

You can create your own copy of that to see the script code if you have Google Apps Script enabled on your domain.

Wednesday, June 17, 2009

New release - new features enabled

We have released changes to Google Apps Script including the following new features:

- Control "editor" access to scripts: a new check box was added at the bottom of the editor window called "Inherit Privileges". If checked, all collaborators on the current document can edit the script. Otherwise, only the script author can make changes to the script.

- New Language Service: support was added for automated translations to multiple languages. Here's an example: Browser.msgBox(LanguageApp.translate("This is a test", "en", "es"));

- New URLFetch Service: this allows scripts to communicate with other applications or access other resources on the web by fetching the content at any URL. Here's an example: Browser.msgBox(URLFetchApp.fetch("http://www.google.com").getContentText());

Please continue to give us feedback on any issues you find or on the Google Apps Script features you are using... post your comments and questions in our forum at http://www.google.com/support/forum/p/apps-script?hl=en - as that's a large part of our process for prioritizing changes and new feature requests. Thanks!

Monday, June 1, 2009

Old tool, new tricks

I like to think I can do practically anything in a spreadsheet. But it's probably more accurate to say that I like to *try* to do anything in a spreadsheet whether or not I can succeed.

Of course, my spreadsheet of choice is the kind I can access from anywhere and share in real time – in Google Docs. So, some would say that even when it makes no sense, I try to do things in a spreadsheet (case in point – my poker simulator – why'd I do that?) But there are some things I never thought possible, like sending an email or reading my calendar.

That's why we're excited to announce a limited test of a new feature which lets people add customization and automation to Google Apps, starting with spreadsheets in Google Docs. We call this feature Google Apps Script.

Google Apps Script provides the ability to automate a variety spreadsheet actions, such as reading and changing values in cells and ranges, changing formats and formulas, and creating custom functions. It also reaches outside of spreadsheets to allow you to send email or create calendar entries.

Check out the
Google Apps Script overview, below, and watch our example of sending email from Google Spreadsheets.



As Google Apps Script is in limited test, we see it as a puppy who's still in training. In fact, just this week, he learned to fetch (URL content) and speak (translate to other languages). But we think he's ready now for some time outside his yard.

So we're inviting a limited number of Google Apps domains – about a thousand organizations – to start playing with Google Apps Script and giving us feedback so we can quickly understand which tricks would be the most beneficial to learn next.

If you're like me and like to stretch spreadsheets to their limit, and don't mind working with early release features, you can get involved in Google Apps Script now by
applying to join this limited test phase.