Here's another little Docs annoyance that can easily be cleaned up with a little automation. If you are using headings in your document, and insert blank lines beside a heading, you end up with uneven blank lines since they will take the format of the heading level rather than just a normally spaced line. Here's a snippet to clean that up.
The hierarchy array lists out all the heading levels to consider for conversion. I guess there may be some reason that you want to exclude some.
The demote variable says what heading level matching blank paragraphs should be set to.
This function provides a dry run capability that reports which headings it plans to demote, then set this false when ready to commit.
Here's the kind of update you get.
And that's all there is to it. Here's the code
For more like this, see Google Apps Scripts snippets. Why not join our forum, follow the blog or follow me on twitter to ensure you get updates when they are available.
You want to learn Google Apps Script?
Learning Apps Script, (and transitioning from VBA) are covered comprehensively in my my book, Going Gas - from VBA to Apps script, available All formats are available now from O'Reilly,Amazon and all good bookshops. You can also read a preview on O'Reilly.
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > Google Apps Scripts snippets >