Note: This is the 4th of 3 previous posts about hacking Google Apps to attempt to create a usable Booking System.
First run this code from the Script Editor. It will make you a "Calendar Sheet" with X number of items as columns and Y dates as rows.
Now some code to add an "Administration" menu that people can use to click on a cell and book a "something or other".
This is a bit of code where you name your column names. You might want to do this by hand, with "Apples, Oranges, Pears, Kumquats" etc.
Now these two functions do the work of creating an Event in an actual calendar and marking the spreadsheet to say it has been booked.
And there it is. It'd be true to say, there's more that it doesn't do than it does. For example, if I delete an item created in the calendar ( for real ) the spreadsheet doesn't automatically make the slot available again, but this is doable with a Triggered check on each item.
It's an encouraging start though. My only nagging doubts about how to deal best with the delay between creating an event and being able to then manipulate it, because the code continues executing but the documentation says it can be minutes before your event appears in the Calendar. At the moment I'm just lobbing in a few delays() ... but that's not right is it?