How to insert a smart quote while recording a macro?
Whenever i have “record macro” on and type shift-quote, i get the straight quote mark instead of a curly; doesn’t matter if alone, before or after a word. As soon as i turn the macro record off, the shift-quote makes proper curly quotes.
Any way to make a macro that when used inserts the proper beginning or end curly quote where used?
I don’t know a keyboard directly addressing “curly quotes”. Do you?
If you type a text in, say, LibreOffice Writer there may be active a so called AutoCorrect Option
to make a replacement. What characters are used as “typographical quotes” depends on the locale or your settings.
This automatism isn’t active while you record a macro.
To be able to give additional useful advice I would need to know what you finally want to achieve by your recorded macro, In most cases I can imagine, an AutoText
entry might be much morte recommendable than a recorded macro.,
Thank you, Lupp, for your help.
I do a lot of work with text generated by Google Docs making an OCR of a pdf of a page from a magazine, which i then copy into Librewriter for editing. Alas, the OCR makes quotes all straight, but in a way Auto-correct won’t change.
So, what i want is to be able to highlight an occurrence of straight quote, right click the text context box, and run a macro that will change it to a curly quote. Or if not a macro, something i can put in the context box to do the same thing. Running auto-correct>apply doesn’t change the straight quotes, though the keyboard does automatically use curly quotes when typing.
I have tried to use search-and-replace with a copy of the OCR quote in the search box and typing the quote mark in replace, but still no curly quotes. And i need the “smart quote” feature to determine if it is an opening or closing quote, so it is very time consuming to use an opening quote manually only in places where that is needed, then the closing quotes.
Any Suggestions for something easier?
In appreciation, --dan
Using @Lupp sample I found that making a selection and then clicking Tools > AutoCorrect > Apply worked well, even if there was an error such as two single quotes side-by-side (still changed to two curly singles) or missing " (did not affect any other quotes)
(Regarding the answer on my comment.)
This should be done with F&R imo.
Suppose you have lots of as-if-words with prefixed and postfixed straight quotes.
You may first find all suspected occurrences of the situation one by one using F&R with the RegEx
"([^"]+)"
One found where you want to replace the occurrence, you can do so using “$1” in the Replace-field.
If you get a wrong result due to an unpaired quote, correct this error in advance and start the F&R anew. …
(The Find-String I posted above can be refined.)
Also Your OCR may allow for settings making the quotes-pass in the process omittable.
Thank you again – i tried what you suggested, but after find has the beginning quote and press "replace,"i get this
and not just the opening quote by itself. How to correct?
You wrote, “One found where you want to replace the occurrence, you can do so using “$1” in the Replace-field. If you get a wrong result due to an unpaired quote [???], correct this error in advance [???] and start the F&R anew. … (The Find-String I posted above can be refined.)” but i don’t know what you mean; could you please be more explicit?
In appreciation, --dan
This is what I actually wrote:
I made an example to get thinmgs even clearer:
disask86662CurlyQuotesForStraight.odt (68.0 KB)
Beyond that I can only go (I think) actually writing a macro. Wouldn’t like to do so. The field is mined.
Did you check if your OCR sofware can be set to use the quote characters you want from the beginning. They should be experts in related problems. And they took a fee, didn’t they?
Thank you SO MUCH for hanging in there with me till i “got it!” What you told me worked perfectly, and i will save and use it now after each OCR transfer to LibreWriter.
The OCR i use is the one included in Google Docs, which doesn’t allow for such fine tuning (in preferences, curly quotes is checked, but doesn’t give curly quotes in output text). Researching online, they recommend to first open the image PDF in MS Word, but the free online version of Word doesn’t allow for that, and living under the poverty level on Social Security, i try to avoid unnecessary purchases of software… and by your kindness, that has once again been possible.
Bless you dear Soul, for your patience with me and your gentle kindness!