Hacker News new | past | comments | ask | show | jobs | submit login
Google Apps Script (google.com)
116 points by thedufer on May 15, 2013 | hide | past | favorite | 34 comments

I have used this fairly extensively in helping a large volunteer organization manage a staggering array of Google forms, docs, and so forth.

As another commenter said, it is like VBA except you get to use JS which is nicer. You can do quite a bit with these scripts. More than you might think. But... It has serious drawbacks.

1. The script implementation has been changing often and without warning.

2. It fails unpredictably with no indication of what the problem is (the built in log is limited and it is difficult to tell where the source of trouble is -- Google Docs? the spreadsheet you're working on? a bug in the code?)

3. Undocumented bugs are rampant. Real example: you add a small script in the responses spreadsheet to send e-mail confirmation to people who submit a Google form. It uses the built-in onFormSubmit trigger. By all appearances, this will start to e-mail everyone going forward. Instead it e-mails everybody who has ever submitted since the form went live.

4. Sometimes runs incredibly slowly with no apparent reason.

Like everything else in Google Docs, there are lots of things you just can't do -- some by design, some not.

I'd definitely have to agree with the caveats having used App Script a fair bit w/ various Google Spreadsheets.

The documentation is thin and you'll find lots of long-standing issues only through digging through various support/group threads, the debugging is obtuse and unsuitable for triggered actions - there's no logging.

The killer though is that the performance/rate limiting is crap - as your document gets bigger, your functions will fail and time-out semi-randomly, even if you're not making a significant # of API calls. Presumably this is because of the way that GDocs are XML streams internally - but even doing single getsheets in calls (no cell iterating) seems to cause problems.

I couldn't find good caching/global storage mechanisms in the past - but hadn't seen ScriptDB before, so maybe that can help (storing in scratch sheets doesn't help since you need to use the API calls to get that stuff)

Anyway just some of my experiences for those who are interested in working w/ App Script for Google Spreadsheets. It's been years since I touched any Excel Macros, but they worked a lot better than my experience w/ App Script.

This has been around for yes, but new features were announced yesterday:


Unless Google has dramatically improved performance, this is not good for anything beyond toy examples. Apps Script seems to suffering from the NotLovedByImportantExec syndrome, hence the lack of serious development resources.

Till about a few days ago, saving a script before running used to take 5 min or so.

Plus you run the risk of getting the rug pulled out from under you when some big shot at Google decides that it 'distracts' from some $important 'core mission' and does not 'align well'.

The biggest plus about Google Apps Script is it runs on .google.com, which means you can do things like set calendar appointments, programmatically access Gmail etc, with the user's authentication cookies.

The biggest minus about Google Apps Script is it runs on .google.com, which means they can't do anything that would let you steal people's authentication cookies. This means all your HTML and user-facing JavaScript needs to be run through a sanitizer (Google Caja), which means the performance really suffers, and there are a lot of things you can't actually do.

It's possible to build a full web application on Apps Script - someone has even ported Bootstrap to it, and most things work - but most people who try quickly hit the limits and move to Google App Engine.

Made a simple, but not that trivial, app with this. A management system using four spreadsheets with 80+ worksheets in each. It worked sometimes, sometimes didn't. I suspect there was some bug, but couln't find anything, the logs are difficult to find.

The spreadsheets aren't a reliably way to store information. Can't query spreadsheets to get information, had to do it by very slow processes.

Everything is slow.

I love the idea, but will not try again until some working large-scale app appears.

Am I correct to think of this as a VBA for Google Apps?

> Am I correct to think of this as a VBA for Google Apps?

It is kind of like that, except that its JavaScript and not Visual Basic, and you can use it for "standalone scripts" and "web apps" in addition to scripted functionality for Google Apps (Docs, Sheets, Forms, and Sites).

That was the very first thing I thought. That is what it seems.

App Script is great for knocking together ad-hoc spreadsheets that pull in data from your company's HTTP APIs.

It's the best thing I've seen so far for giving non-technical colleagues visibility into whatever organisation data you have that's programatically available. They already understand spreadsheets, so there's no complexity to overcome when they come to play with them. It's trivial to base the output on a few user-defined cells, so you can put together fairly powerful features without ever having to build a user interface. You even get to do stuff with the logged in user's Google account. And since the toy apps seldom get too big, JS that you write in your browser is the perfect low-friction development environment.

Great concept but I have a few concerns.

1 - how well can you integrate. As macarthy12 asked can you add links or other changes to gmail.

2 - what's stopping google from looking at the products that work well and just copy them. Basically stealing what you spent 6 months or a year to built and then offer it as part of a built-in feature.

Google started as "do no evil" however, it seems like you can't be a dominating company and not do evil.

Seems useful, How long before it is canceled? ;-)

If you're curious, a model I built ( http://www.gwern.net/Google%20shutdowns ) gives Script a ~25% chance of surviving the next 5 years.

Do you plan on keep this up-to-date based on new data?

I'm collecting data for another update in 5 years when the full period has elapsed (to check the performance of the original model and build a new model based on that and the new entries found in the 5-year interval), but otherwise no, I don't plan to produce rolling 5-year estimates or anything like that.

I would love a gmail script that automatically selected your "from" email based on the tag/folder the email was sent to.

For example, if you receive an email from example+test@example.com then it would automatically select test@example.com (or whatever you set it to) as the "from" field.

I'd be willing to pay for this as I don't think this is possible with Google Apps Script

I think I could do this for you. My mail is hn-username@gmail.com (UK TZ for responses)

This is really impressive. It seems to have much of the functionality needed to create a pretty rich web service.

you obviously never tried to script a spreadsheet in google drive with it... sorry but it sucks period. The only thing that is impressive is people paying for that. It simply doesnt scale when you have large spreadsheets.

Looks great to me - didn't take all that long to automate on of my everyday tasks - check out my experience here: http://blog.nimblegecko.com/using-google-apps-script-for-aut...

How long before GMail is supported and products like Streak (http://www.streak.com/) can be built on top of it and sold in Google's marketplace? This is a game changer and Microsoft should be very, very worried.

This is interesting enough but describing it as "a JavaScript cloud scripting language" just makes me think their marketing person is throwing the word "cloud" in at random points.

Well, if there is anybody who can claim to have "cloud" services, that's Google...

This looks like a neat tool for setting up personal reminders, but it seems like it'd be great to learn javascript on.

Also there are no tabs :(

Trying to figure out if you can add custom menu/actions to Gmail ?? That would be great

AFAIK it is not possible.

May be someone can now crop up a quick and simple Google Reader alternative?

Does anyone really want to code in the browser?

People probably said the same thing about email and office apps 10 years ago.

Most people I interact with still don't want to use Office Apps in the web browser, so it doesn't seem like much has changed on that front.

I think you are missing a big point, or my comment was too short.

If you code locally you leverage years and years of tooling made for it, if you code in that google scripts you are just fucked up. And that's the big difference for me, not the UI.

not yet deprecated?

Can this be used for non-google apps ??

Chack webshell.io for this. It is an open AppsScript like. Still in beta.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact