Sidebars
Sidebars are only available in Google text documents and in form creation UIs. This feature has been introduced quite recently and offers a wide array of possible applications.
We used a very basic example of this in Chapter 2, Create and Manipulate Forms, to show a sample of the last form responses, but we can make it a lot more useful and attractive if we wish.
An impressive example was published a few months ago by a Google engineer on GitHub (https://github.com/google/google-apps-script-samples/tree/master/cursor_inspector).
Cursor Inspector is a script that shows the content and properties of the selected text in a sidebar in a document. From there on, we can imagine all sorts of developments: automatic data insertion in text, contextual help, and so on.
The code of this demo uses Google Apps Script and jQuery in a JavaScript client and is far from simple, but results in something awesome. I can't recommend enough that you give it a try.
The small test we are going to try here is...