You can even write code in coffeescript and have it automatically compile to javascript and sync to the cloud, ready to test. Finally, although Google recently introduced Libraries in Google Apps Script, this approach represents a simple way to share code between projects while still supporting granular permissions.
To get started:
- Set up Google Drive syncing on your development computer.
- Create a new javascript or coffeescript file in your Google Drive folder (coffeescript folks may want to set up an automatic compilation watcher on that folder).
- Open your file in the online Google Drive. It will show in a document viewer, but the important thing to find is the document's id. This is in the url: https://docs.google.com/file/d/{DOCUMENT ID}/edit .
- Create a new Google Apps Script application and paste in the loader code below. Be sure to customize it for the document id you found in step 3. Also, if your code requires any permissions, you'll have to reference them here since Apps Script isn't able to find them in a loaded file.
That's it! When you save the file on your computer, it will sync to Google and Apps Script will load the latest version. If you distribute your application to other users (for example, by including it within a shared spreadsheet) remember to set the sharing permissions on the javascript files you are loading or a folder containing both the application and javascript files.
You may also be interested in my open source Apps Script user interface library.