Compile Replacement With \n

dr
drmajorbob
Posts: 236
Joined: Sun Jul 01, 2012 1:38 am
Platform: Mac

Sun Jul 07, 2019 9:42 pm Post

I thought I'd get rid of empty lines by replacing one or more newlines with one newline. That failed because, as the manual says in 11.2.1,

"The find tool cannot work with whitespace symbols, such as \n and \t in the replacement field. Use native whitespace characters instead."

My question is simple. What ARE the native whitespace equivalents of \n and \t?

User avatar
xiamenese
Posts: 3987
Joined: Mon Jan 29, 2007 1:32 am
Platform: Mac
Location: London or Exeter, UK.

Sun Jul 07, 2019 10:34 pm Post

Hold down 'Alt' and press Return or Tab to enter them into the Find dialog. I assume that is what is meant.

:)

Mark
The Scrivenato sometimes known as Mr X.
rMBP 13" (early 2015) 10.14.5, 8GB RAM, 512GB SSID
MBP17" (late 2011) 10.13.6, 8GB RAM, 512GB SSID
2017 iPad, iOS 12.3.1, 128GB, Apple Pencil
Scrivener, Scapple, Nisus Writer Pro, Bookends …

dr
drmajorbob
Posts: 236
Joined: Sun Jul 01, 2012 1:38 am
Platform: Mac

Mon Jul 08, 2019 2:40 am Post

xiamenese wrote:Hold down 'Alt' and press Return or Tab to enter them into the Find dialog. I assume that is what is meant.

:)

Mark

That works in the Find dialog, but not in Compile Replacement.

I realize there are other ways to do this, but I'm trying to figure out how to use RegEx replacements in Scrivener . There's no universe in which "option return" = "native whitespace", either.

THIS works, on the other hand, and I'd imagine it's more efficient.
Screen Shot 2019-07-07 at 9.47.19 PM.png
Screen Shot 2019-07-07 at 9.47.19 PM.png (11.66 KiB) Viewed 248 times

User avatar
nontroppo
Posts: 1148
Joined: Mon Mar 05, 2007 5:22 pm
Platform: Mac
Location: Airstrip One

Mon Jul 08, 2019 2:09 pm Post

Hm, ⌥␣ and ⌥↹ both work for replacements for me, but you cannot see them in the dialog, unless you select and you can see empty space selection:

Screenshot 2019-07-08 at 22.07.05.png
Screenshot 2019-07-08 at 22.07.05.png (4.86 KiB) Viewed 218 times

dr
drmajorbob
Posts: 236
Joined: Sun Jul 01, 2012 1:38 am
Platform: Mac

Mon Jul 08, 2019 4:43 pm Post

nontroppo wrote:Hm, ⌥␣ and ⌥↹ both work for replacements for me, but you cannot see them in the dialog, unless you select and you can see empty space selection:

Screenshot 2019-07-08 at 22.07.05.png


Right you are, mea culpa again. I still wonder what "native whitespace" means.

User avatar
AmberV
Posts: 23337
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Mon Jul 08, 2019 4:55 pm Post

Native as in how the macOS user interface handles these characters, as literals in the field (and by default, awkwardly so since they are invisible, we added display of them in a few contexts, but in things like simple text entry fields like Replacements, they remain invisible.

I've patched up this spot of the manual to be clearer.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles