Atomic Scribbler Home · SmartEdit Home · Help

A small Search & Replace limitation


#1

I was just cleaning up some text, and realized that “typographic quotes” aren’t supported by the Search & Replace tool. Two thoughts on this:

  1. If S&R had a checkbox for “replace straight hyphens & quotes”, then I could just globally convert all hyphens or quotes to proper typographic ones. Sometimes, of course, this is not appropriate, such as when straight quotes denote inches, minutes, seconds, etc.

  2. It wasn’t too inconvenient to just search for double quotes (one can only search for straight ones) and then type a double-quote character over the highlighted “hit” selection. But, not surprisingly, this is handled out of the text-flow context, and straight quotes are inserted, resulting in no change.

The end result is that the only way to convert all the (appropriate) straight single- and double-quotes is to do it manually, without even the assistance of Find’s ability to select a found target. I realize this may require significant surgery to the replace code in S&R…

Allen


#2

It just occurred to me that the “replace by typing over” work-around might not be a problem of the replace code, but may be just a symptom of the focus not being inside the text after a “hit” has been highlighted.

In most editing text search tools, when the found text is highlighted, one can immediately type something, and the highlighted text will be replaced. If that affordance were available, then at least a semi-automated method for converting straight quotes could be used.

Allen


#3

Good catch Allen. In the word processor handling and automatic insertion of smart quotes had to be manually coded. It was a quite a piece of work at the time. But no work has been done on the other dialogs.

The alt character codes will still work to insert the character, but nobody knows alt codes off the top of their heads. For smart quotes they are Alt 0147 and Alt 0148.

https://usefulshortcuts.com/alt-codes/punctuation-alt-codes.php

But this still doesn’t help when it comes to replacing straight quotes with smart quotes. Going the other way would be easy, but with smart quotes, as the open and close quote is a different character the replacement would need to calculate which straight quote to make an open and which to make a close.

Not an impossible job, and it would be interesting code to write, especially when the edge cases are taken into account: quotes that stretch across paragraphs where a close is not required before the next open, using of the " character for purposes other than quotes.

You’re right about this. It’s incorrect dialog behaviour that’s causing the problem here.


#4

Darren, I still have the complete list with all ANSI codes as a PDF. It’s a legacy from my former times with technical writing, working with FrameMaker, etc.! Still using the PDF often enough when it comes to temperature degree, exponents, fractions, or something like special characters in expressions of foreign languages.

If you or anybody else would like to get a copy of it, just get in touch with me. I can easily email it as an attachment. :slight_smile:


#5

I would forgive you if non-closed quotes spanning paragraphs weren’t handled correctly. I’m willing to do some of this by hand.

In the meantime, if S&R just shifts focus back to the edit pane, that would save me a lot of clicky fiddling. At present, I position the S&R dialog alongside the AS app titlebar, so I can click NEXT and then the titlebar, thus allowing one whack of the " key to make the correction. With the focus fixed, that would eliminate 1/3 of the clicks, which would be welcome in novel-sized manuscripts!

Allen


#6

I’ll add the dialog fix to the list for the next release Allen. In the meantime you could close the dialog after the first find and use the F3 shortut to jump to each of the other instances, changing as you go.


#7

Thanks! I’ll use the F3 tactic for now - I don’t know why I didn’t try that. F3 is very standard for “repeat search”. (Although it is handy to keep the dialog open.)

Allen