Categories
general

Scrivener stuff, 2026 edition

 

I write my books with Scrivener. I have since 2011. It has a daunting learning curve, and I feel like I used 10% of the features on my first book with it, and slowly gained maybe 2% per book. I’ve previously written posts here and here on tips and tricks. I’m not trying to make this a “make big money self-publishing your books!” blog, but I have a need to write this stuff down so I don’t forget it and can find it later. So, here’s another crop of answers for you. Caveat emptor: there are probably better or more preferred ways of doing this. I just beat things until they work.

OK, here we go, in no particular order.

Show the number of files in a folder in the binder

View > Outline > Show subdocument counts in binder. (There is also a View > Outline option at the top of the View menu, which is confusing.)

Show where the current scriv is in the binder

Navigate > Reveal in Binder. Or Cmd-Opt-R. Memorize that; I use it 50,000 times a day.

Exporting keywords

  1. Create a blank text document.
  2. Open the keywords (Project > Show Project Keywords, or Cmd-Shift-K)
  3. Click the first one; shift-click the last one.
  4. Drag them into the blank text document. This exports a comma-delimited text list of the keywords

Adding your own icons

  1. Go to https://www.iconsdb.com and download a 32x32px PNG.
  2. Right-click an item in the binder,
  3. Change Icon > Manage Custom Icons, and add your PNG. Note the name in the menu will be the name from the PNG, so rename the PNG accordingly.

WordPress import

  • You can drag HTML files into the Research section of Scrivener, but not Draft.
  • After they are dragged in, they are uneditable web archives. Go to Document > Convert > Web Page to Text
  • There was a wp2epub plugin that would also do html, but it’s broken in new WordPress versions, hasn’t been updated in 167 years.
  • Tried WP2Static for this… it was slow so I stopped
  • There was an XSL for this see https://www.literatureandlatte.com/forum/viewtopic.php?f=19&t=34656&p=223492#p223492 but it no longer works, I get errors.
  • This is horrible but you could export WordPress to Jekyll…
  • Another option: https://wordpress.org/plugins/aspose-doc-exporter/ – couldn’t get this to work
  • wp2static – crashes
  • I might have to do this again soon, so stay tuned.

The delete comment bug

If you add a comment to some text, then remove the comment and edit the text, the hyperlink text comes back, but with no attached comment

Workaround: highlight the text, delete the comment, cut the text, then Paste and Match Style it back.

Background image

Scrivener 3 – change the background image in compose mode: Project > Project Settings > Background Images (this moved since 2)

Searches and collections

You can turn on and off viewing collections with View > Hide Collections and View > Show Collections. Normally I turn them off because it drives me nuts to have them there and waste space in the binder.

But, here’s how you use them.

  1. Do a search on the project, Cmd-Shift-F
  2. Search on something fun, like do a search on a keyword or a status
  3. Click the magnifying glass to the left of the search term again. Scroll all the way to the bottom and select Save Search as Collection.

Now, that search is going to be in the Collection part of the binder. It’s also going to be dynamic. So for example, if you have a keyword for a character (or whatever) and you save a search as a collection, that collection will enable you to quickly pull up that list of documents.

Numbering problems

This is confusing, bear with me.

Let’s say you have a book that’s three acts and a hundred scenes in each act. You want each act to have a title page, and then each scene is its own deal.

Then let’s say you want number the scenes, like with a number at the top of each one. What’s going to happen is the title page is 1, and your first scene is numbered 2, and you probably want it to start at 1, right?

  1. File > Compile
  2. Select a Format in the left column (or create a new one).
  3. In the right column, set all of the scrivs to a section type. For this example, I’m using Chapter Heading and Scene, plus Front Matter for stuff that’s not part of the book itself.
  4. Click Assign Section Layouts. Select Scene.
  5. (Tip: if you do this 19 times in a row because you keep changing this, it will always open at the first section type. You’re inevitably not editing the first section type. You open it, you’re in the first type, and it doesn’t look right, and you’re sure this stupid program burned you again. It’s because you’re in the wrong section type. Always click the right one first. This is annoying that it doesn’t persist your selection, but here we are.)
  6. Pick a layout for the Scene. Hover over it and click the pencil in the upper right to edit it. Then click Edit <whatever> Layout.
  7. If you’re using a number and a title, click Title Options and in Title Prefix, put <$n:scene>. Don’t put <$n> or it will increment when the title pages are incremented.
  8. If you want only a number, don’t do that. Go to Prefix, and in the Section prefix, put <$n:scene> and center it or whatever you need to do.

Start numbering at 0

We get it, you studied computer science.

Use a placeholder <$n-1> instead of <$n>. Or <$n:scene-1>. Internally the counter is still 1, 2, 3 etc. But when you display it, you are subtracting one so it’s 0, 1, 2, etc. (It doesn’t actually modify the value of the counter. It just displays it one lower.)

Yes, Scrivener doesn’t call them variables. They’re called placeholders. If you’re searching their manual, it’s called a placeholder, not a variable. I’ll use the words placeholder and variable once again so this actually shows up in search, like it doesn’t in their manual. Placeholder=variable.

How many comments are in my document?

grep -r "Comment ID" my-book-file.scriv/Files/Data | wc -l

Let me know if any of these are helpful or blatantly wrong. Like I said, I don’t always know what I’m doing, but I’m sure I’ll need to know the same exact thing later.

Leave a Reply