views:

553

answers:

1

If I create a Google apps script, can I hook it up to Google spreadsheet to run based on an event, or must I manually invoke it?

I don't know if Google spreadsheet supports any events.

For example: a Google app script that strikes out rows in the spreadsheet that have been marked completed by way of a column having the digit 1 beside completed rows. I would like this to run whenever a row is modified, or even when the spreadsheet is first loaded.

+1  A: 

The function onOpen() is automatically executed every time a Spreadsheet is loaded. In the future, we will expose a general event API, but until then you can simply define your own function as long as it is called onOpen().
From the Section 2 of the Tutorial

There is also **function onEdit() ** as can be viewed in at:
http://www.google.com/support/forum/p/apps-script/thread?tid=584a17c79e4c04d5&hl=en
It seems that event handling is in flux and dependent on security issues being worked out.

Michael
Out of curiosity would you per chance be a Google employee on the Docs team? ref: "we"
John K
@jdk I am not a Google employee. The 'we' was part of the tutorial I copied and pasted. Should have been more specific about attribute-From the Section 2 of the Tutorial.
Michael