How to BOLD. A particular part of text?

547 views
Skip to first unread message

Dhanya

unread,
Aug 28, 2022, 12:24:48 PM8/28/22
to TextSoap
I have managed to ‘clean up’ the selected text, now I want some parts of it in BOLD, some ITALICISED, and some UNDERLINED. How can I do that?

Mark Munz

unread,
Aug 28, 2022, 3:29:05 PM8/28/22
to TextSoap
I'm assuming there is some pattern to when you want to bold or italicize the text.
The If Matches Text, or If Matches Regex (depending on setting) lets you match specific text and then apply actions. In this case, we're setting the font style to bold.
CleanShot 2022-08-28 at 12.27.26.jpg

On Sun, Aug 28, 2022 at 9:24 AM Dhanya <vimala...@gmail.com> wrote:
I have managed to ‘clean up’ the selected text, now I want some parts of it in BOLD, some ITALICISED, and some UNDERLINED. How can I do that?

--
You received this message because you are subscribed to the Google Groups "TextSoap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to textsoap+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/textsoap/d4b40b5e-60ee-4106-a330-95dec090ac48n%40googlegroups.com.


--
Mark Munz
unmarked software
http://www.unmarked.com/

Mark Munz

unread,
Aug 28, 2022, 3:30:57 PM8/28/22
to TextSoap
Oops, forgot the explanation. 
The If Matches Regex expression: \bA\w+ will match any words that begin with "a" and bold them.

Dhanya

unread,
Aug 29, 2022, 12:34:10 PM8/29/22
to TextSoap
I showed the action I had run earlier, when I look at in the preview window it works, but when I apply it ‘live’ it doesn’t. Why is that?

Dhanya

unread,
Aug 29, 2022, 12:34:10 PM8/29/22
to TextSoap
Got it, thanks. I wanted to match a line that starts with the word Chapter. So, this is what I did and it works! Many Thanks.

Bold a line.png

Jay Allbritton

unread,
Aug 29, 2022, 1:04:23 PM8/29/22
to text...@googlegroups.com
Mark,

How would you set up a regex find and replace custom cleaner that would bold everything before a colon or an en or em dash?

Dhanya

unread,
Aug 30, 2022, 7:27:37 AM8/30/22
to text...@googlegroups.com
F25FADC5-B437-4707-9954-E3B42D1B33F2.jpegSample of the text.jpegI am attaching the image that I can see in the preview window after I run the action. How do I now ‘REPLACE’ the original text? The screenshot of my action is also posted in an email I sent yesterday.

Mark Munz

unread,
Sep 2, 2022, 3:22:00 PM9/2/22
to TextSoap
In your headings, you have two colons, so I want to make sure I understand correctly.
Are you just wanting the Chapter + number bolded? 
And are looking for it to be more generic (so that it matches lines that don't have a 'Chapter')?

I will make some assumptions here:

CleanShot 2022-09-02 at 12.16.19.jpg

Here, the expression matches from start of line ^, Chapter, .*? (anything else), [:–—] up through colon, en-dash, em-dash.
Finally they are all wrapped up in ( ) to capture them. And the Match is set to $1, which is the first capture group.

Finally, I use the new Set Style action to make it Bold. If you aren't on the new beta, you can use the Set Font option:
CleanShot 2022-09-02 at 12.19.26.jpg
The Style option is moved to the end starting in 9.2b3 as well, but otherwise works the same.

If I misunderstood, please let me know.


Reply all
Reply to author
Forward
0 new messages