9 Replies Latest reply on Jan 8, 2016 1:00 PM by Jump_Over

    Stray rules

    jamesrobertmuir Level 1

      I want to search a document for all occurrences where a "rule above" has been applied through "paragraph rules" (not in a style)...the "find format" in find "test" or "grep" does not include "paragraph rules". Thanks

        • 1. Re: Stray rules
          jamesrobertmuir Level 1

          that should have said... find "text" or "grep"...

          • 2. Re: Stray rules
            Jump_Over Level 5

            Hi,

             

            ruleAbove and ruleBelow are properties of paragraph or style (regardless of text) - thats why no such options in findText utility.

            Only way I can see is to iterate through stories.everyItem().paragraphs.everyItem() and make 2 tests:

            • if ruleAbove == true;

            and

            • if appliedParagraphStyle.ruleAbove == false;

             

            Jarek

            • 3. Re: Stray rules
              jamesrobertmuir Level 1

              Thanks Jarek

               

              forgive my total lack of scripting knowledge but is

              stories.everyItem().paragraphs.everyItem()

              a grep command or a apple/javascript?

               

              and the next question how do I run the tests?

               

              My goal is to locate/assess each occurrence individually to ensure that, when "rule above" removed, the formatting remains as desired. There have been occurrences where "rules above" have been applied manually and crash into/lay on top of the previous paragraphs  "rule below" but slightly offset and with varying indents...The existing "rule below" is a legitimate paragraph style that should remain.

              • 4. Re: Stray rules
                Jump_Over Level 5

                Hi,

                Lack of scripting knowledge can lead you into troubles... using scripts...

                Sometimes...

                 

                Run this using ESTK or save as .jsx file and place into Panel Script folder (which let you doubleclick on it from ID UI):

                #target indesign
                var
                  mParas = app.activeDocument.stories.everyItem().paragraphs.everyItem().getElements(),
                  cPara;
                
                  while (cPara = mParas.shift() )
                  if (cPara.ruleAbove  && !cPara.appliedParagraphStyle.ruleAbove) {
                  cPara.showText();
                  $.sleep (500);
                  cPara.insertionPoints[0].select();
                  if (!confirm ("Do a job and continue?")) break;
                  cPara.ruleAbove = false;
                  cPara.insertionPoints[0].select();
                  $.sleep (400);
                  }
                

                 

                Jarek

                • 5. Re: Stray rules
                  Obi-wan Kenobi Adobe Community Professional

                  Hi Jarek,

                   

                  Can we do the same treatment about conditions? E.g. find text with condition x even if another condition(s) a (b, c, …) is (are) applied (or not)! [not possible with a F/R].

                  Thanks for the answer!  ;-)

                  • 6. Re: Stray rules
                    jamesrobertmuir Level 1

                    awesome

                     

                    thanks

                     

                    Jim

                     

                    jimmuir@rogers.com

                     

                    H  613_728_5914

                    C  613_325_1748

                     

                    504 Fraser Avenue

                    Ottawa, Ontario  K2A 2R2

                    • 7. Re: Stray rules
                      Jump_Over Level 5

                      ...[not possible with a F/R]...

                      Hi Obi-wan,

                       

                      What do you mean "F/R"?

                       

                      Jarek

                      • 8. Re: Stray rules
                        Obi-wan Kenobi Adobe Community Professional

                        Find/Replace 

                        • 9. Re: Stray rules
                          Jump_Over Level 5

                          There is no such property "ruleAbove" for findTextPreferences, so this utility is out of use.

                          However - in other cases - I use it very often to select first array of texts to be filtered and tested with next set of conditions.

                           

                          Jarek