If this is your struggle, and you don't want to lug a typewriter to your local coffee shop for your writing time, then The Most Dangerous Writing App is here to help you. It's a simple text-based app that deletes everything you've written if you stop for five seconds.
I tested it out, and it really works! If you stop typing, a looming sea of red starts to lower down from the top of the screen until - BLAMMO! - it's all gone.
On the other hand, if you succeed, it then allows you to save your text. All it does there is take you to a plain text screen that only has your writing on it, that you can then copy and paste into any document.
I can see this as the perfect way to force a book out of you, chapter by chapter, do your morning pages, or otherwise just get something written. It is, of course, incredibly dangerous, but all you need to do is keep on typing (so maybe map out what you want to say beforehand, if that's an issue for you.)