Quote: My friend came round for the afternoon so I didn't have to be alone.
Good idea...for support, and since things have escalated (in case he stops by, does something else, etc.).
Quote: He has never maltreated them, but he doesn't care how he treats me in front of them, which is almost as bad.
It is almost as bad...it has a similar effect because he is hurting a huge part of them (you).
Quote: Instead I finish my book and get a publisher to accept it.
This is a huge sign of progress. FWIW, I'm also writing a book (my second actually) and hope to publish it in the fall. I was working on it before my separation/subsequent D occured, but everything ground to a halt for six months. I didn't feel like writing anything at all. My heart was not in at all, and I have loved to write in some form or another ever since I was a little kid. That is now changing, and I'm sinking some of that energy that could be spent on being sad into writing. So far, it's worked amazingly well, although some days I veer back towards not wanting to write anything at all.
Above all, stay safe, though. You have a lot of people pulling for you here from what I've seen.