Today I released the first version of ”Spreadsheet Actions”. It is a small framework for Google spreadsheets, allowing actions to be run on selected rows in a spreadsheet. This could for example be used for:
- Sending customized emails
- Copying and sharing files
- Creating folder structures in Google Drive
- Importing/exporting contacts to Google contacts
- Managing student workbooks
The whole idea with Spreadsheet Actions is that new plugins could be written when there is reason to. You want to create a new folder in Gmail for every student in your class? That would be (at most) 50 lines of code. You want to append text to Google documents? That would be another small plugin.
In this blog post I’d like to explain a few ideas behind Spreadsheet Actions, but first a few links:
- The source code at GitHub (open source!)
- Videos introducing Spreadsheet Actions alpha-1
- Get your own copy of the latest stable version
Why a framework for spreadsheet actions?
You may have heard of gClassFolders, Doctopus, mail merging scripts, and maybe even StudentMatrix. They all allow using data in Google spreadsheets to make tasks easier – create a folder for every student, share files with students, and so on. What’s the point in adding another tool for executing actions from spreadsheets?
This is actually my fourth go at something like this. Every time before I have been creating a tool that is intended to do one single task, or tasks within a well defined space (such as colouring cells in multiple spreadsheets at once). An every time I have ended up wanting to do more in the same tool.
The idea with Spreadsheet Actions isn’t necessarily to bring new types of actions, and definitely not to bring the best of user interfaces. It is to be a framework where new types of actions easily could be added.
Good bye, nice user interface
I’ve had the idea for something like Spreadsheet Actions for quite some time, and one of the obstacles was how to create a nice user interface – preferably without making new plugins a hell to write. If the plugins should not only define new actions, but also describe interface for any settings, writing plugins quickly becomes a minor science field in itself. And the framework becomes a mess of abstraction layers. Not the best conditions for an ecosystem of spreadsheet actions.
I thought this was the end of my plans for a spreadsheet action framework. Until I realized that it, in some ways, makes sense to have all the settings and options right in the code.
In more than one way it is absolutely horrible to have settings in code. It ruins version control, it risks having nosy users screwing up the non-settings code, and the usability is crap compared to a slick graphical interface. But all (or most) of these factors are not an issue when it comes to Google scripts – they can’t be version controlled in any regular way, the user only has access to his/her own copy of the code, and nice graphical interfaces are really difficult to get into Google scripts anyway.
So there it was – I went for putting all the options in the code. Time will tell if it works out.
What Spreadsheet Actions contains, so far
So far, Spreadsheet actions has the following:
- A simple way of declaring ”bulk actions” (executed for all selected rows) and ”global actions” (executed for the spreadsheet as a whole).
- Dependency declaration – you can tell what other plugins your plugin depends on, and which versions. These plugins will be loaded before any actions are run.
- A simple framework for automated testing, but no tests yet.
- A handful of plugins, allowing emailing, file management (including access control), importing/exporting contacts, and management of ”student workbooks”.
Each plugin is its own script file, with any settings at the top. (The plugin itself is a pseudo-class you inherit from.)
(Note: Spreadsheet Actions cannot, as things are now, be an add-on for Google spreadsheets. This is because the code for add-ons cannot be edited by the user.)
If you’re interested in trying out Spreadsheet Actions, I recommend looking at the first few videos in the video list linked above. If you have written Google scripts, I would then recommend looking at the example plugin on GitHub. After that I would create a copy of the latest stable version, and try it out.
If you have any comments or ideas, I’d happy to hear them.