Find/Replace Invisibles

I remember doing this last year, but I can’t remember how I did it and my attempts to recreate the magic have disappeared.

I write in “web” mode - that is, I put two carriage returns between paragraphs.

I need to export in “manuscript” mode - carriage return followed by tab between paragraphs.

I’ve been able to do a find/replace on invisible characters easily in ms word and other text editors, but I can’t quite figure the trick in scrivener.

How would I go about a find/replace of EnterEnter with EnterTab for Scrivener? (I’m hoping that doing so will ONLY do it for the folder that I’ve chosen “Edit Scrivenings” on.

Any help would be appreciated. Thanks!

Text>Show Invisibles if you want to see it all, though that’s not necessary.

Use Edit>Find… (cmd+F) to do a Find and replace either for the selected file or selected text (so you could select all in an Edit Scrivenings session). Use copy/paste to select the double carriage return for the find field and then again for the carriage return and tab that you want to use to replace it. Or you can do it all keyboard shortcuts, opt+enter for the carriage returns and opt+tab for the tab character in the find box.

Edit: Oh, also I was going to say, if you’re actually doing the Compile, you can set the tabs in that for the formatting, rather than changing them in the actual documents, if you prefer to work without them when you’re writing.

Thank you!

I wasn’t able to get it to find/replace JUST the Edit Scrivenings, but it was cake to make a copy of the scrivener file, do the find/replace there, then copy over just the altered folder that I wanted.

Thank you thank you!

I’m glad you were able to get something that worked, but you really should be able to do it on a single file or only selected text. Did you use Project Replace instead of the regular Find/Replace? That of course does the entire project. If you just the regular find (Edit>Find>Find…) you can select there whether to do the find/replace through the selected file or selected text. To do it all at once for select multiple files, you can go into an Edit Scrivenings session then do “select all” to get all the text from the whole ES session, and then run the find/replace choosing “selected text.”

Anyway, I’m glad you were able to do what you needed!

Ah, I bet I missed the “select all” step after entering the “Edit Scrivenings” session. I’ll make a note of that (I’m writing down the steps I took this time, since this is something I’ll be repeating on a yearly basis).

Thank you again!

I’m following the directions in this thread and not getting desired results.
I’m editing a long text in which every paragraph ends with a single return,
followed by a character space and a tab.
I want to find that string, and Replace All with two returns and a tab.

I can turn on Invisibles, copy the string, and then turn on Project Replace.
I paste in the errant string, but can’t return to the text for the replacement string.
Nor can I enter that in Project Replace, since Tab and Return control that dialog.
It’s a real dilemma. Every word processor I use has better format editing.
But I don’t want to export 200,000 words just to make that correction.
Especially since this text will become an e-book, assembled in Scrivener.

The instructions above were for using a regular Find/Replace, which functions like the Find/Replace dialogues you’re used to from other programs. If you’re using Project Replace, you don’t refocus in the editor–it replaces in the entire project, based on the scope you choose in the Project Replace dialogue–so you’ll need to just enter the characters directly. You need to hold the Option key while pressing Return and Tab in order to enter those characters.

Thanks, MM…but I tried that and it doesn’t work.
Just says Not Found
The first string I can copy and paste.
(I see now that Scrivener always adds a space after a return, so I won’t search for that)
The replacement sting is two returns and a tab.
I do that, with the Option key pressed down, and…Not Found.

Whoa, on 2nd and 3rd try, I got it to make changes, but not what I wanted.
And I can’t Undo or get it to find the new bad strings. Woe is me.
Finally: I got it back to normal with the Services: Reformat key.

Unless it’s vitally important that you modify the text you typed, I think the Compile options are the way to go here. Using the “Replacements” tab in the compile settings, you can create a rule that, on Compile replaces all instances of two carriage returns with just one.

So, in the Replacements tab, click the + button to add a new replacement rule.
Then, in the “Replace” column, hold down the option key and hit twice. (Nothing will really show here, but the invisible characters should be there if you selected the entry area correctly).
Finally, in the “With” column, add a single opt- character.

(IF there is a way to show the invisible characters here, I’d love to know how… or better yet, just have them shown by default)

When using the compile settings with this rule in them, the output will replace two adjacent paragraph/carriage return characters with just one. You’ll never have to do that search-and-replace again!

One final note on this pane. I just discovered (new for 2.1?) that there are two tabs: Project Replacements and Preset Replacements. If you want to use the setting in future projects, then Preset is probably the way to go. To save your new settings, along with any other changes you’ve made to the compile presets, hold down Option (which changes the Compile button at the bottom to Save) and click Save. It will now be part of that Compile preset when selected for other projects.

Thanks, Robert; all great suggestions.
I avoided Compile because I wanted to see the effects of text-editing in the Draft.
The paragraphs were all run together, and I wanted a blank line between them.
If this were an original MS, I’d just pass it to a word-processor for the formatting.
But e-book assembly is different. It goes straight on to KindleGen.
It would help a lot if Show Invisibles also made those characters visible in the Replace dialog.
Or let you pick them from a menu palette.
Something for a future version, perhaps, as more folks use Scriv to create e-books.
Anyway, I managed to get all the chapters cleaned up, using good old Reformat.

Oh, for you Druid, it makes much more sense to add in the paragraph separators in the Draft documents. I was thinking that for Wiskerwing’s “web mode”, reducing the 2-lines between paragraphs to one was a wasted exercise in the editor if that’s the writer’s habit; Compile settings solve that problem once and for all. Glad you were able to untangle your experimentation to add extra para separators… I shudder to think what a S&R mistake like that could do to the 120k-word rough draft that I’m about to finish. Woe indeed!

I’m still having enough trouble with this situation that I’d like to make a feature request.
It’s especially important when editing texts to create e-books.
We can turn on Invisibles to see paragraphs, tabs, and spaces in the text.
But not in the Find & Replace dialog.
If we could have an Advanced or Option button there, that allowed inserting Invisibles,
Like: find Paragraph Space Tab and replace with Paragraph Paragraph Tab
The editing could proceed much more efficiently.
I’d prefer to do it document by document, instead of through Project Replace.
Several tries there have produced disasters. (can’t see Invisibles there, either)
And I don’t want to request the change in the Compile dialog
Because it’s important to see the editing changes now, whizzy-wig
At the moment, I am copying text units over to Pages, making the edits,
And pasting them back into Scrivener. Really tedious, and prone to error.
Would this be hugely complicated change to the Find/Replace commands?
LATER: Thought I had resolved the editing in Scrivener, but no dice.

I am seconding this as a feature request, having run into a very similar issue when compiling for e-books. My issue was with a tiny handful of formatting errors, where for some reason a paragraph did not have a hard return at the end, and the following paragraph was preceded by a tab (rather than the default first line indent). The result looks perfect in Scrivener, so unless you’ve got Show Invisibles turned on, you can’t see the errors – until they show up as run-on paragraphs in the e-book version.

Took me a while to figure out how to do a Find/Replace for these invisible characters. Having them built into an Advanced Options section in the Find/Replace dialogue box would be wonderful.

This is on the list for the future but will most likely be a 3.0 addition, as it’s much more difficult to implement than you’d think - show invisibles itself is special code added to the text view, and it is much more technically challenging to add this code to the sort of text fields used by Find panels.

All the best,
Keith