Changing single quotes to double

Is there any way that quotation marks can be changed across a whole manuscript (or even a scene) from single to double without messing up the apostrophes in contractions and possessives. My reason is that Serenity Editor, possibly the best grammar and spelling-checking software on the planet allows its comprehensive checking to exclude writing within double quotation marks thus avoiding wading through dozen of irrelevant bad grammar points. I have used single quotation marks and now regret it.

But not, as far as I can see (having never previously heard of the application), on the Mac. Are you sure you’ve chosen the right sub-forum? :slight_smile:

I have chosen the right sub-forum, at least it doesn’t matter and the Mac version of Scrivener is more advanced. Editor is PC only but it isn’t interactive so it doesn’t really matter whether you import text into it from Mac or Windows so long as you have access to the software through Codeweavers or Parallels.

There’s no really easy way to do this, but I think with some thought and judicious use of snapshots in case things go horribly wrong, you can get most of the way to your goal.

On the Mac, you can input carriage returns into search fields by holding down OPT when you press return. Why would you need to? Because searching for a CR directly before a single-quote will get you the quotes that start a paragraph, except those that are the very first character in a document. Searching for a quote followed by a CR will get you all quotes at the ends of paragraphs, except where they are the last character of a document.

Noting that apostrophes are always between two letters, you can also search for single quotes that have commas, periods, question marks, exclamation marks and other punctuation before or after them. That will get a lot of the remaining quotes.

Then, you’d be best served doing searches for every remaining single-quote character and deciding on a case-by-case basis if you should substitute or not.

This will be complicated by the use of “smart” quotes, but should still be workable (you’ll have to copy a left & right curly quotes and paste them in to the search fields, I think).

Thanks. Sounds like a lot of work. It would be just as easy to leave things as they are and speed through anything that Editor comes up with that lies within quotation marks. I wish I’d know that Editor’s creator would introduce this useful facility when I first starting writing this book. Maybe I’ll leave until next time.

Firstly, if Serenity Editor is the best grammar and spelling-checking software on the planet, how come it isn’t customisable enough to support custom ignore field delimiters?

Having said that, if you’re running 10.9 (I think) then you can use regex in project replace. It’s worth learning regular expressions if you haven’t already. It’s straightforward to search for any instance of ’ which is followed by something other than a letter, and replace that with ”. If I imagine correctly, this shouldn’t produce any adverse results. I can’t think of a scenario in which you’d have ‘ which isn’t a quote mark, so that one’s easy.

Search for:

’([^a-z])

And replace with

”\1

Copy those and paste them. They’re directional. After you do that, you can globally replace ‘ with “ and you"re home free! :wink:

But just on the off-chance that there are some instances of ’ that escape your memory right now that get accidentally changed to double quotes, maybe backup first. Or hope that they’re marginal enough that you’ll be able to change them back by global replace later.

Thanks for your replies . . . but I’m afraid you assume too much of my knowledge. You lost me at regex. If you could explain more simply it sounds like a helpful idea.

Regex is basically a system of wildcards for text searching and matching patters. [a-z] will match any alpha character, ^ is a negator for the wildcard, and parentheses denote a text to be captured. So this regular expression says ‘find any rightward single quote that is next to something other than an alphabet character, and remember that character’. The replace one says 'take the result of the first regular expression and replace it with a rightward double quote followed by whatever the following character in the search was (the bracketed text).

If you’re on the latest mac and latest scrivener, you should have regex search (also called grep) as a checkbox option in edit > project replace… It’s a good idea to try searching by it first before you replace, to see if you regular expression is matching the right stuff.

For a quick (half hour) guide on regular expression syntax (I always forget the little things), there’s a tutorial at regexone.com

Thanks very much. I’ll try that out.

For the future, in your compile settings, there’s a pane called “Replacements”. If you use straight quotes, you can set that to change " to '. If you use smart quotes, you can add two entries, one for left-double to left-single quotes, and one for the right-quotes. Save that as a preset, and you can quickly output with one kind of quote mark or the other without touching the original files inside Scrivener.

The problem with project replacements is that it will also change things like ‘I’m’ to ‘I"m’. You have to use regex for this, as you have to exclude these forms.

Replacements do support regular expressions, so it could still be done automatically when compiling. The main problem I see with the pattern is that it will falsely match plural possessives and any colloquial usage of the apostrophe, such as he’s goin’ places, but if neither of those are used much it’s probably fine.

That’s a good point. I neglected to think about plural possessives and word-final apostrophes. Interesting to learn that project replace supports regex too. I’m not upgrading my machines to 10.9 until I finish the thesis, so can’t make any use of it (it certainly would have come in handy a few weeks ago).

Regex should be available from 10.7 onward, so you wouldn’t even need to go all the way to bleeding edge if you didn’t want to.