Automated way of italicising text between speechmarks (double or single curly quotes)?

In MS Office O365 MS Word) I could easily use a wildcard search/replace to select text between curly quotes and apply ‘emphasis’ (italics of some kind).

I’m new to Scrivener. I’ve been searching the net for a way to achieve the same. No luck after the last few days. I’ve looked into the compiler but can’t see a way to achieve my objective.

I am grateful for help.

Scrivener has Regular Expressions instead of Wild card search. With the correct RegEx, you can find text between quotes, and set them to italics.

2 Likes

Did this work for speech that continued for more than one paragraph where you left the closing inverted comma until the speaker was done?

In MS Word this procedure works https://i.imgur.com/rLfHDzf.png

But Scrivener needs a different mindset:

  1. It functions similar to Word in the front-end writing and formatting. It uses styles similarly but one can’t think of it ‘as Word’.
  2. The compiler is Scrivener’s big advantage - but also a challenge for noobs like me.

@AntoniDol I’ll be looking into Reg Expressions to see if I can re-create some sort of script that mimics what I would do in MS Word. This resource may help: Using Regular Expressions in Your Scrivener Editing Process - Lancy McCall

I’m grateful if anyone else who is interested can join in the effort. :pray:

1 Like

You could ask ChatGPT to construct a RegEx for you. But be prepared to go into “conversation” with it before it gives you what you really want.
Even teach it the advanced Word approach according to Word’s surrounding language as background information and then formulate your question.

You could ask ChatGPT to construct a RegEx for you. But be prepared to go into “conversation” with it before it gives you what you really want.
[To others - to avoid drift - this is only about Scrivener, not MS Word. Scrivener is very different in function and strategies for managing text aka Scrivenings]

Done that with three AI’s: Claude and Gemini (using equivalent of ‘gems’ in subscriptions) having uploaded all recent manuals on Scrivener. Both failed. Gemini failed even with deep research.

ChatGPT sent me crazy a couple weeks ago so ditched my subscription, and I’m not going back. Copilot AI (Microsoft) failed similarly.

1 Like

To me ChatGPT and Copilot are the same—well, they respond too similarly (same layout, contextualising and word choice) to not be interwoven into one another.
If I recall the person whose website you mentioned for RegEx solutions is a Mac user and the RegEx code differs on Windows and Mac.

That’s great. My experience is different on the particular problem I’m working to find a solution.

This one might work for you…

[“"'](.*)[”"']

[““'] matches a single character in the list “”’
. matches any character (except for line terminators)
* matches the previous token between zero and unlimited times, as many times as possible
[”“'] matches a single character in the list ””’

HTH

2 Likes

Tried that before. It didn’t work. It looked nice though.

Works for me:

  1. Start Project Search with the RegEx operator and the RegEx above.
  2. Press Enter to Search
  3. Click the Editor to give it Focus
  4. Press F3 to select first match
  5. press Ctrl+I to make italic
  6. F3 for next match,
  7. press Ctrl+I to make italic
  8. Rinse and Repeat…

2 Likes

Thanks. The code certainly selects relevant text between curly speech marks. However, there is no automated process in the method above to replace all such text (like when using a wildcard search in MS Word.) The manual process of italicising selected text in Scrivener is what I am trying to avoid. I have 100,000+ words among which I’d have to ‘rinse and repeat’ manually some 500+ times.

Even if an automated process is found eventually, preserving italicised text when compiling then becomes the next challenge.

My strategy for working on this so far is:
1 - Select all text in the editor between speech marks (curly double quotes) and italicise with a named character style that does emphasis.
2 - Instruct the compiler to ignore text marked with the said character style.

The above may take some work and not produce the result I need. If/when I fail, I’ll move to another strategy.

The only other software I know of that can find and replace formatting is InDesign. Maybe you can postpone this action until the production phase of your book?

1 Like

Affinity Publisher can also search/replace styles. See the search/replace help info.

1 Like

That would do nothing, right?

To ensure the character style has effect in the compiler, make sure its is added to the Compile Styles in the Compile Format Designer’s Style pane, and is set to the correct – italic – formatting.

1 Like