Highlighted

Regex capture when searching for a character or paragraph tag?

Community Beginner ,
Apr 05, 2019

Copy link to clipboard

Copied

Is there a way in the Find/Change dialog to search for a character tag, capture the corresponding text and use that text in the Change field?

Adobe Community Professional
Correct answer by Lynne A. Price | Adobe Community Professional

Ah, I think I misunderstood your original question.

If I've got it right this time, you want to add a prefix and suffix to all text strings tagged with a particular character tag? That explains why you referred to regular expressions in the title of this thread. FrameMaker can use regular expression conventions to add a prefix and suffix to a found string, but only if that string was found by searching for a regular expression. A variation of the complex instructions in my previous suggestion would let you search for the character tag, then search for a regular expression consisting of the string you've already found, and then use regular expression conventions to add the prefix or suffix. Not something that would be very practical to repeat numerous times.

This may be a good candidate for scripting.

    --Lynne

Views

278

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Regex capture when searching for a character or paragraph tag?

Community Beginner ,
Apr 05, 2019

Copy link to clipboard

Copied

Is there a way in the Find/Change dialog to search for a character tag, capture the corresponding text and use that text in the Change field?

Adobe Community Professional
Correct answer by Lynne A. Price | Adobe Community Professional

Ah, I think I misunderstood your original question.

If I've got it right this time, you want to add a prefix and suffix to all text strings tagged with a particular character tag? That explains why you referred to regular expressions in the title of this thread. FrameMaker can use regular expression conventions to add a prefix and suffix to a found string, but only if that string was found by searching for a regular expression. A variation of the complex instructions in my previous suggestion would let you search for the character tag, then search for a regular expression consisting of the string you've already found, and then use regular expression conventions to add the prefix or suffix. Not something that would be very practical to repeat numerous times.

This may be a good candidate for scripting.

    --Lynne

Views

279

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 05, 2019 0
Adobe Community Professional ,
Apr 05, 2019

Copy link to clipboard

Copied

When you have selected text in your document and you switch from the document window to the Find/Change dialog box when the current search option requires text, FrameMaker copies the selected text into the search field.

In your case, you can therefore:

1. Select Character Tag from the pull-down menu at the top of the Find/Change dialog box, type the name of the character tag you want in the text box underneath that option, and click Find or press Enter.

2. The focus is still in the dialog box and you want to switch back to the document without removing the selection. You can do so either with Shift F7 or by clicking an empty spot on the title bar at the top of the document window.

3. Go back to the dialog box with Ctrl-f or Edit > Find/Change. FrameMaker copies the selected text (the result of the first search) into the search field in the dialog box but the search type is still set to Character Tag.

4. Change it to Text and click Find or press Enter.

     --Lynne

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 05, 2019 0
Community Beginner ,
Apr 05, 2019

Copy link to clipboard

Copied

Hi Lynne, Maybe I am misunderstanding your response, but I am not trying to look for specific text.

I am looking for arbitrary text of in a given character format so that I can then wrap that text in additional characters.

I need to capture that arbitrary text so I can use it in the change box.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 05, 2019 0
Adobe Community Professional ,
Apr 05, 2019

Copy link to clipboard

Copied

Ah, I think I misunderstood your original question.

If I've got it right this time, you want to add a prefix and suffix to all text strings tagged with a particular character tag? That explains why you referred to regular expressions in the title of this thread. FrameMaker can use regular expression conventions to add a prefix and suffix to a found string, but only if that string was found by searching for a regular expression. A variation of the complex instructions in my previous suggestion would let you search for the character tag, then search for a regular expression consisting of the string you've already found, and then use regular expression conventions to add the prefix or suffix. Not something that would be very practical to repeat numerous times.

This may be a good candidate for scripting.

    --Lynne

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 05, 2019 0
Adobe Community Professional ,
Apr 07, 2019

Copy link to clipboard

Copied

Hi Pdeitel:

I can do this in InDesign, because InDesign separates formatting from the Regex queries. I can't see any way to accomplish this in FrameMaker. I wish we could get more of InDesign's Find/Change capabilities into FrameMaker.

~Barb

Screen Shot 2019-04-07 at 1.39.30 PM.pngScreen Shot 2019-04-07 at 1.39.45 PM.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 07, 2019 0