Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Find/Change paragraph style only overrides local formatting

Return to Member Forum

  • Author
    Posts
    • #103621
      Kate Basart
      Participant

      When I use FIND/CHANGE ALL, to replace one PARAGRAPH SYLE with another, all local formatting is removed. However if I use FIND/CHANGE and go through one instance at a time, the local formatting stays in place. Does anyone know why? Is there a preference/setting I am missing? I have a script that needs to FIND/CHANGE ALL, but I need to keep the local formatting for a separate search. Any insight would be greatly appreciated, thank you! I am not asking it to search for or change the character styles at all. Using InDesign CC 2018. (iMac)

    • #103622
      Graham Park
      Member

      You can delete on Paragraph Style and you will be asked what to paragraph style to replace it with. No search required and the local formatting is unaffected.
      If you have Character Styles applied again this formatting will stay when you do the FIND/REPLACE ALL.
      Why it is different between FIND and FIND ALL I’m not sure.

      Use Character Styles for the local formatting and you will not have the issue in future.
      You could even set up the Character Styles and do a find and replace to apply this to your current document then you can run your script without the issue.

    • #103623

      var myDoc = app.activeDocument,
      myParaStyle1 = myDoc.paragraphStyles.item(“X”),
      myParaStyle2 = myDoc.paragraphStyles.item(“Y”);
      app.findGrepPreferences = app.changeGrepPreferences = null;
      app.findGrepPreferences.appliedParagraphStyle = myParaStyle1;
      myFound = myDoc.findGrep();
      var F = myFound.length, f;
      for ( f = 0; f < F; f++ ) myFound[f].applyParagraphStyle (myParaStyle2, false);
      app.findGrepPreferences = null;

      Best,
      Michel, from FRIdNGE
      michel.allio.fridnge@gmail.com

    • #103628

      Another reason to use Character Styles as much as possible!

    • #103629
      Kate Basart
      Participant

      Thanks for the ideas and the script. My issue is a bit complex in that I am using a find/change script to run through a very long document (500pgs) which has complicated styling. I can’t delete one paragraph style in lieu of another because in my script I am temporarily separating parenthetical text, assigning it a different (temporary) paragraph style, then searching within that text for local italic formatting, replacing that with my italic character style, and then returning the parenthetical text to its original paragraph which returns it to the original paragraph style. (I can’t just search for local formatting “italic” because all the parenthetical text needs to be in a lighter typeface). If I could just figure out how to do a find/change ALL without eliminating the local formatting, that would solve it.

    • #103633

      ???

      So! … You just want to find “italic” formatting (override) and replace it by an “italic” char style, that in all “specific” paras! …

      Right?

      Best,
      Michel

    • #103635
      Kate Basart
      Participant

      Right, but when I break the section that is in parentheses into a separate paragraph with a different paragraph style, it eliminates the local formatting so there is no more italic to find and assign the character style to.

    • #103640

      Just a question: why change the para style applied?

    • #103641
      Kate Basart
      Participant

      Because otherwise I would end up changing all the Italic to the same character style but I need 2 different character styles for Italic: 1 for the medium typeface ital, and 1 for the light typeface ital that is within the parentheses.

    • #103642

      Could you post a saple screenshot?

    • #103644
      Kate Basart
      Participant

      Yes. Thanks for being willing to look at this. I have no idea how to upload a screenshot here though.

    • #103645
      Graham Park
      Member

      Are the Italics in Medium and Light in your document now?
      If they are then you can find the Medium Italic apply a Medium Italic character style. The find the Light and apply a light italic character style.
      You can specify using any or all of font, paragraph, character style etc to find and apply character or paragraph styles.
      Then you can run your script.

    • #103646
      Kate Basart
      Participant

      Wouldn’t that be nice. But no, they are just in a default italic that comes in from word. That’s the problem, ALL italics are the same and I am trying to convince them that they need to be different in different situations.

    • #103647
      Kate Basart
      Participant

      Another option: Does anyone know the GREP for “Find local formatting Italic within parentheses” (So only the ital would be found in the parentheses and then I could apply a character style.

    • #103648

      Do you wanna the 2 regex or the JS code?

    • #103655
      Kate Basart
      Participant

      The RegEx would be great

Viewing 15 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads