Jump to content
You must now use your email address to sign in [click for more info] ×

Publisher: Limit scope of Find and Replace?


Recommended Posts

I've got a rather large document (300+ pages) that is divided into sections. The text gets placed then a few "find & replace" steps are done to clean things up before flowing. Works great, but no I have some small "find & replace" steps that need to only happen to particular sections and there doesn't seem to be any way of scoping this to section or even to selected text areas. This is supper problematic as the changes I need to make to smaller sections (15-60 pages) would wreck major layout issues if they are done to the entire document.

Link to comment
Share on other sites

Find/Replace as currently implemented apply to the entire document.

There are some ways, using the Regular Expression option of Find/Replace, to reduce that scope, but for now the only ones that I have found involve making some small changes to the document.

For example, if you wanted a particular change to occur only to the text contained in a certain set of linked text frames that spans pages 5 through 10 then you could:

  1. Pick a text string that does not occur in your document, perhaps something like %%%
  2. Add that string at the beginning of the text frame on page 5, and at the end of the text frame on page 10.
  3. You could then do a Find/Replace, with the Regular Expression option turned on, where your regular expression will look for %%% at both the start and end of the expression.In the middle you would build the rest of the regular expression to find the text that needs to change. And then you would use a corresponding regular expression Replace string to actually make the changes.
  4. After the Find/Replace operation, you would remove the marker from the start and end of the text frames.

Note that if your Publisher document is organized as separate Stories, where a Story is a complete set of linked text frames, and you want to restrict the Find/Replace operation to one particular Story, you can just add the marker at the start of that Story, and for the end of the Regular Expression you can use \z in the expression, without needing to insert the marker into the text frame. But you still need the marker at the beginning of the Story.

Note, too, that step 3 can be tricky, and will of (course) require knowledge of regular expressions. For example, to change the name Tom to Fred within that set of text frames, something like this might be used as the Find expression: (%%%.*?)(\bTom\b)(.*%%%)

The Replace expression would then be \1Fred\3 (or $1Fred$3).

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

Thank you Walt for the detailed response. I'm actually much more familiar with regex than I am publisher documents so by the time I got to your reply I had already built an external text processing tool and rebuilt the pages based on that output. I missed the regex option in Publisher as it didn't occur to me to just set unique text markers in the frames. Duh... I over engineered a solution when there was an easy one sitting right there.

Hopefully in the future they as scope to the Find & Replace features, but this is a solid work around. Or better yet, a scripting interface for automation throughout the suite.

 

Thanks

Edited by Pelted
Link to comment
Share on other sites

  • 2 months later...

I'm also finding the inability to scope Find and Replace to be problematic at the moment.

I'm already using complex regular expressions so could expand those but it's not ideal.

I also can't do the work outside of Publisher because I am applying styles on the replacement.

Then again, the only reason I have to be doing these Find and Replace actions is because it's the only way to get styled text into Publisher. (I copy Markdown so I have the characters to target for replacing with styles.)

 

Link to comment
Share on other sites

  • 4 weeks later...
On 2/4/2020 at 8:56 PM, Pelted said:

I've got a rather large document (300+ pages) that is divided into sections. The text gets placed then a few "find & replace" steps are done to clean things up before flowing. Works great, but no I have some small "find & replace" steps that need to only happen to particular sections and there doesn't seem to be any way of scoping this to section or even to selected text areas. This is supper problematic as the changes I need to make to smaller sections (15-60 pages) would wreck major layout issues if they are done to the entire document.

I agree: it should have an easy way to limit the scope when choosing "Replace All", i.e only the selected text or the selected story (linked text frames). Regular Expressions are OK for very advanced users but not for normal people, and Affinity Publisher is aimed for regular people, right?

Link to comment
Share on other sites

  • 10 months later...
3 minutes ago, Bryce said:

has this been fixed at all?

No, it has not been improved yet.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.