
Google Apps Script - thedufer
http://www.google.com/script/start/
======
ims
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.

~~~
lhl
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.

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

[http://googleappsdeveloper.blogspot.com/2013/05/new-apps-
scr...](http://googleappsdeveloper.blogspot.com/2013/05/new-apps-script-
features-at-google.html)

------
arunabha
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'.

------
crb
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.

------
fiatjaf
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.

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

~~~
dragonwriter
> 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).

------
cantlin
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.

------
salimmadjd
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.

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

~~~
gwern
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.

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

~~~
gwern
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.

------
twodayslate
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

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

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

~~~
camus
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.

------
smartial_arts
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...](http://blog.nimblegecko.com/using-google-apps-
script-for-automating-small-tasks/)

------
troygoode
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.

------
seldo
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.

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

------
neaanopri
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 :(

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

~~~
jamesaguilar
AFAIK it is not possible.

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

------
alcuadrado
Does anyone really want to code in the browser?

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

~~~
bitcrusher
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.

------
franze
not yet deprecated?

------
andyl
Can this be used for non-google apps ??

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

