Tuesday, February 9, 2010

Google Sites for Apps Script

Today we're announcing a new enhancement to Google Apps Script: the ability to create and access Google Sites.

Using the new SitesApp Service, your scripts now have full control over your sites including adding attachments, changing the text within a web page, and even adding new collaborators to your sites so you can share and edit them with your friends. For more details, see the Apps Script Sites documentation.

A good example came to our attention recently as a colleague set about improving the organization of his soccer league. He had to create home pages for each of the teams, with information on each of the players in the league. Before long, he was overwhelmed with the task of managing all of the information on these sites.

Luckily, the players were already listed in Gmail Contacts, and training times and matches were already entered on Google Calendar. It proved a simple task to write a script that created a new Google Site for each team, pulling in player details from Gmail Contacts, and copying training and match details from Google Calendar.

This automation saved him a lot of repetitive button pressing, and it made adding future team sites a snap.

A tutorial detailing the creation of a site in script can be found here. You can take it a step further by using one of the many site templates that are freely available. Start by creating a site customized from your chosen template, and then update it with team specific content using Apps Script.

We think this is a great example of taking useful information from semi-private, hard-to-access sources, and sharing it with a wider audience – be it your soccer league, your enterprise, or the entire world.


  1. We could learn a lot from crayons. Some are sharp, some are pretty and some are dull, Some have weird names , and all are different colors, but they all have to live in the same box.............................................

  2. I keep looking for a way to create a site from a templete using script. Thats what I need to be able to use the script in the situations that I see. I need to be able to create a form that users fill out and have a script to create a site using their responses to set up the pages. But to make it fit the rest of our company 'intranet', I need to be able to create the sites from a template.

  3. Do you have a sample that utilizes setcontent call of either webattachment/filecabinet page to upload documents through scripts?

  4. 行動養成習慣,習慣培養人格,人格影響命運 ..................................................

  5. 真正的友誼,有如健康失去時,始知其價值..............................