How can I extract highlighted text?

I have highlighted the spoken words of various characters with different colours. Now I would like to extract all the dialog spoken by a particular character (highlighted in green) in order to check the consistency of his language. How can I construct a printable file with only the green-highlighted text?

Although there is no automatic way of doing this, I can think of a way of gathering these highlighted ranges of text together. One of the nice things about Scrivener is that it builds your entire binder into the menu system beneath commands that can be useful for automation—such as the Edit/Append Selection to Document/ sub-menu. This is significant in that the Mac allows one to customise application menus, meaning that for various reasons (navigating to things, filing items to folders, or appending text to documents) you can target specific documents in your Binder with a keyboard shortcut of your choosing.

So the first thing to do is make that a place in the Binder to store the green highlighted text. I put a file into Research called “Green Person Speaks”, for purposes of this example. The next step is to create your keyboard shortcut pointing to that document. In my example, the shortcut for this would be: “Edit->Append Selection to Document->Research->Green Person Speaks”. Just do the same thing with the “path” to your document, putting “->” in between each level of menu. It’s important to use the full menu path for your shortcut since, as I say, the “Green Person Speaks” item will be added to multiple menus throughout the application—you need to tell the Mac precisely which one to target.

Try it out, select some text in a document and click through the menu hierarchy until you find your file. You should see the keyboard shortcut beside it if all went well. Dismiss the menu, select some text, and press the shortcut. Does the text arrive in the file? If so, you’re ready to go. (Note you may have to do that at the start of each session, thanks to a quirk in OS X menu shortcut assignment and these sorts of dynamically built menu structures—basically it will not “know” of a menu command until you look at it once).

Next, we’ll use the Find by Formatting tool to jump through the whole project looking for highlighted text. This is the Edit/Find/Find by Formatting… menu command. Set the “Find” mode to highlighted text, right-click on the colour chip and set it to the same green you ordinarily use, then click “Next”.

Now at this point you could close the find box and rely upon the Shift-Opt-Cmd-G menu command (these are the Next and Previous commands for find by format, at the bottom of the Edit/Find sub-menu. Since finding a highlighted range selects it, all you need to do next is press your shortcut to append the selection to the Green Person Speaks document, alternating back and forth between those shortcuts until you have them all.

Wow, Amber, that works! A bit tedious since there are many bits of dialog, but thanks a lot! I wasn’t aware of the possibility of defining my own shortcuts.