24 Replies Latest reply on Nov 3, 2012 5:36 AM by chrlsdrwn12

    [JS][CS4]Look for Resized frames

    chrlsdrwn12 Level 1

      Hi Scripters,

       

      We are following a very strict guidelines based on a typesetting specifications. One of these guidelines is all text frames should always fit on margin rules never ever resized it. But still some of the hard headed staff are doing this. So I'm looking for a way to check for a resized text frames all through out the documents on a book then if found take the page number and document name where it has been found then report it in an alert or something. Anyone has any idea? Thanks in advance...

       

      -CharlesD

        • 1. Re: [JS][CS4]Look for Resized frames
          Jump_Over Level 5

          Hi Charles,

           

          I would start from changing app preferences, assuming user used to resize your frames accidentally.

          Menu:Edit:Preferences:Global:

           

          notice Object Edition check box (Prevent Selection of Locked Objects)

           

          if NOT checked - user are still able to change the content but resizing and removing is locked.

           

          You can place a small script into ...Scripts:Startup Scripts folder:

          ___________

          #target indesign

          app.generalPreferences.preventSelectingLockedItems = false;

          ___________

           

          to switch this option off each time InDesign starts

           

          hope it is a solution...

           

          Message was edited by: Jump_Over

          • 2. Re: [JS][CS4]Look for Resized frames
            Trevorׅ Adobe Community Professional

            Hello again,

             

            I'm not quite sure that Jumpovers solution is workable.

            Which if any of the screenshots below if true?

            1

            Untitled-1 @ 68%_2012-10-29_11-18-49.png

            2

            Untitled-1 @ 68%_2012-10-29_11-17-24.png

            • 3. Re: [JS][CS4]Look for Resized frames
              Jump_Over Level 5

              Hi Trevor,

               

              I assumed proper text boxes are predefined and already set in document and only problem is users use to resize them by their unreliability.

              • 4. Re: [JS][CS4]Look for Resized frames
                chrlsdrwn12 Level 1

                Hi Guys,

                 

                After layout has been finalized image number two should always be the case. I have no clue why the client is very strict about it but its always been a feedback to us so we assigned somebody just to check all application files make sure everything is OK. The problem is if a book has thousands of pages the checker manually go thorough all the spreads and pages so i'm thinking it is something that could be done in script. Thanks guys.

                 

                -CharlesD

                • 5. Re: [JS][CS4]Look for Resized frames
                  Sajeev Sridharan Level 4

                  Hi Charles,

                   

                  If a textframe exceeds page bottom margin, it will generate the report in the indesign path. I fixed only for bottom margin, you can modify the script for left and right margin also.

                   

                  Hope the below script help you...

                   

                   

                  var aDoc = app.activeDocument;

                  aDoc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;

                  aDoc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;

                   

                   

                  for(i=0;i<aDoc.pages.length;i++)

                  {

                            var m = aDoc.pages[i].marginPreferences;

                            var gbounds = [m.top, m.left, aDoc.documentPreferences.pageHeight - m.bottom, aDoc.documentPreferences.pageWidth - m.right];

                            aDoc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;

                            var page = aDoc.pages.item(i);

                            var k=0;

                            for(j=0;j<page.textFrames.length;j++)

                            {

                                      var frame = page.textFrames.item(j);

                                      var myFrameBottomBounds=frame.geometricBounds[2];

                          //----------- bottom margin ------------------

                                      var myPageBottomBound=page.bounds[2] - page.marginPreferences.bottom;

                            if(Math.round(myFrameBottomBounds)==Math.round(myPageBottomBound))

                            {

                                      k=1;

                            }

                            else

                            {

                                      k=k+k;

                            }

                  }

                   

                   

                  if(k==0)

                  {

                            write("Page Number: " + (i+1) +"\r\r");

                  }

                  }

                  if(k==1)

                  {

                            write('No Text Frame Exceeds Page Margin\r\r\r');

                            }

                   

                   

                  function write(text){

                                      var myDocument=app.activeDocument;

                                      var myFilePath1=myDocument.filePath + "/" + "Frame Exceeding Margins" + ".txt";

                                      var myTextFile = new File(myFilePath1);

                                      if ( myTextFile.exists )

                                                {

                                                myTextFile.open("e");

                                                myTextFile.seek(0, 2);

                   

                                                }

                                                else {

                                                myTextFile.open("w");

                                                }

                                      myTextFile.write(text);

                   

                   

                  }

                   

                   

                  -Vandy

                  1 person found this helpful
                  • 6. Re: [JS][CS4]Look for Resized frames
                    Jump_Over Level 5

                    Hi,

                     

                    It could be done by script in a pretty easy way, but...

                    1. Are you looking for completed script or

                    2. Are you looking for help in some part of script you want to create by yourself?

                     

                    An idea is:

                    to define content geometricBounds for pages (odd/even if facing);

                    to iterate through a doc pages comparing textFrame.geometricBounds with defined ones;

                    to collect differences;

                    to alert them.

                    • 7. Re: [JS][CS4]Look for Resized frames
                      Trevorׅ Adobe Community Professional

                      Hi All,

                       

                      I think Jumpovers work flow is good.

                      This uses XML markups and prints a report on the JS console if you have markups then only run the script on a copy of the doc!!!!.

                      I didn't take into cosideration stroke alignment

                      This is how I would do it.

                       

                      // Script by Trevor to show Bad Text Frames http://forums.adobe.com/thread/1089938
                      // Open JS console on ESTK
                      #target indesign
                      
                      app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.FAST_ENTIRE_SCRIPT, "Highlight Bad Text Frames");
                      
                      function main()
                      {
                      var  doc = app.activeDocument,
                              pl = doc.pages.length,
                              badTextFrames = [],
                              myXMLViewPreferences = doc.xmlViewPreferences;
                              myXMLViewPreferences.showAttributes = true;
                              myXMLViewPreferences.showStructure = true;
                              myXMLViewPreferences.showTaggedFrames = true;
                      while (pl--)
                          {
                          var pm=doc.pages[pl].marginPreferences,
                          pmTop = pm.top, pmBot = pm.bottom, pmLeft = pm.left, pmRight = pm.right
                          pb = doc.pages[0].bounds,
                          tf = doc.pages[pl].textFrames,
                          tfl = tf.length,
                          pb[0] += pmTop, pb[1] += pmLeft, pb[2] -= pmBot, pb[3] -= pmRight;
                      
                          while (tfl--)
                              {
                                  var tfGeo = tf[tfl].geometricBounds;
                                  if (tfGeo.toString() != pb.toString()) badTextFrames.push(tf[tfl]);
                               }
                           }
                      var btfl = badTextFrames.length;
                      while (btfl--) 
                          {
                              $.writeln("TextFrame["+badTextFrames[btfl].id+"]"+"  on Page " + badTextFrames[btfl].parentPage.name + " is BAD (:-(");
                              xmlTag (badTextFrames[btfl]); // Delete this line if you don't want to tag
                           }
                      
                      function xmlTag(objectToTag)
                            {
                              if (objectToTag.associatedXMLElement==null) xmlFrame = doc.xmlElements [0].xmlElements.add ("Bad_Frame" , objectToTag);
                              else
                                 {
                                     objectToTag.associatedXMLElement.untag();
                                     xmlFrame =doc.xmlElements [0].xmlElements.add ("Bad_Frame" , objectToTag);
                                  }
                              }
                      }
                      

                       

                      Enjoy

                       

                      Trevor

                      • 8. Re: [JS][CS4]Look for Resized frames
                        Trevorׅ Adobe Community Professional

                        Hi Charles,

                         

                        It occured to me that by adding some functions that I had from a previous script I could make it very flashy

                        Try out the below script and if you think it will save you or your company tons of money you can even make a small donation to my UK regitered charity (send a private mail for details)

                         

                        // Script by Trevor to show Bad Text Frames http://forums.adobe.com/thread/1089938
                        // Open JS console on ESTK
                        #target indesign
                        #targetengine Trevor
                        app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.FAST_ENTIRE_SCRIPT, "Highlight Bad Text Frames");
                        
                        function main()
                        {
                        var  doc = app.activeDocument,
                                pl = doc.pages.length,
                                badTextFrames = [],  textFramesDetails = [],
                                myXMLViewPreferences = doc.xmlViewPreferences;
                                myXMLViewPreferences.showAttributes = true;
                                myXMLViewPreferences.showStructure = true;
                                myXMLViewPreferences.showTaggedFrames = true;
                        while (pl--)
                            {
                            var pm=doc.pages[pl].marginPreferences,
                            pmTop = pm.top, pmBot = pm.bottom, pmLeft = pm.left, pmRight = pm.right
                            pb = doc.pages[0].bounds,
                            tf = doc.pages[pl].textFrames,
                            tfl = tf.length,
                            pb[0] += pmTop, pb[1] += pmLeft, pb[2] -= pmBot, pb[3] -= pmRight;
                        
                            while (tfl--)
                                {
                                    var tfGeo = tf[tfl].geometricBounds;
                                    if (tfGeo.toString() != pb.toString()) 
                                        {
                                            badTextFrames.push(tf[tfl]);
                                            textFramesDetails.push("TextFrame["+tf[tfl].id+"]"+"  on Page " + tf[tfl].parentPage.name+ "\r")
                                         }
                                 }
                             }
                        var btfl = badTextFrames.length;
                        while (btfl--) 
                            {
                                $.writeln(textFramesDetails[btfl] + " is BAD (:-(");
                                xmlTag (badTextFrames[btfl]); // Delete this line if you don't want to tag
                             }
                        
                        var w = new Window ("palette");
                         myList = w.add ("listbox", undefined, textFramesDetails, {multiselect: false, });
                        var makeReport = w.add ("button", undefined, "Create Report Document");
                        myList.onChange = function () {badTextFrames[myList.selection.index].select()};
                        makeReport.onClick = function () {setupDoc()};
                        w.show();
                        
                        function xmlTag(objectToTag)
                              {
                                if (objectToTag.associatedXMLElement==null) xmlFrame = doc.xmlElements [0].xmlElements.add ("Bad_Frame" , objectToTag);
                                else
                                   {
                                       objectToTag.associatedXMLElement.untag();
                                       xmlFrame =doc.xmlElements [0].xmlElements.add ("Bad_Frame" , objectToTag);
                                    }
                                }
                        function setupDoc()
                            {
                                var doc2 = app.documents.add({documentPreferences:{facingPages:0, pageOrientation: PageOrientation.PORTRAIT}});
                                var m = doc2.pages[0].marginPreferences,
                                mtb = doc2.pages[0].bounds,
                                tb = doc2.pages[0].bounds;
                                mtb[0]=mtb[2]-m.bottom,
                                ms = doc2.masterSpreads[0].textFrames.add ({geometricBounds:mtb, textFramePreferences:{verticalJustification:VerticalJustification.CENTER_ALIGN}});
                                ms.parentStory.properties = ({digitsType: DigitsTypeOptions.ARABIC_DIGITS, hyphenation: 0, justification: Justification.CENTER_ALIGN, paragraphDirection: ParagraphDirectionOptions.LEFT_TO_RIGHT_DIRECTION, contents: SpecialCharacters.AUTO_PAGE_NUMBER});
                                tb[0] += m.top; tb[1]+=m.left; tb[2]-=m.bottom; tb[3]-=m.right;
                                var tf = doc2.pages[0].textFrames.add({geometricBounds:tb});
                                ps= tf.parentStory;
                                ps.properties = {digitsType: DigitsTypeOptions.ARABIC_DIGITS, hyphenation: 0, justification: Justification.LEFT_JUSTIFIED, paragraphDirection: ParagraphDirectionOptions.LEFT_TO_RIGHT_DIRECTION, rightIndent: 2};
                                ps.contents += myList.items;
                                app.changeGrepPreferences = app.findGrepPreferences = null;
                                app.findGrepPreferences.findWhat = ",";
                                app.changeGrepPreferences.changeTo = "";
                                ps.changeGrep();
                                app.findGrepPreferences.findWhat = "\r";
                                app.changeGrepPreferences.changeTo = " is bad.\r";
                                ps.changeGrep();
                                if (ps.overflows) addPages(tf);
                            
                                function addPages(ptf)
                                    {
                                        var np = doc2.pages.add();
                                        var ptf = np.textFrames.add({geometricBounds:tb, previousTextFrame: ptf});
                                        if (ps.overflows) addPages(ptf);
                                    }
                            }
                        }
                        
                        • 9. Re: [JS][CS4]Look for Resized frames
                          chrlsdrwn12 Level 1

                          Hi guys,

                           

                          Sorry for a late reply.

                           

                          @Vandy, thanks for the script I tested it doesn't seem to function correctly. I tried resizing the main text frame shorter or longer than the margin and the script is writing same result. And oh the script only reads page 1.

                           

                          @Jump_over, very good thinking how did you read my mind? Yes this is part of a bigger script. When I post something here I think of a way on how other users would benefit from my post not just for my own use coz i know we have different needs. So I used to ask generic questions on how to do this and how to do that then i start from that and build for my own needs (though im not very good so it takes me a while to figure things out but its ok).

                           

                          @Trevor, I ran the script and the console said the object doesn't support 'parentPage'. Send me the details my boss came from UK so he might like the idea.

                           

                          This script is more complicated than i thought. The main text frame is on layer 1 and the image/table frames are on layer 2 which is on top of the main text. The main text should always be exactly on the margin boundaries it should not be longer or shorter but some staff used to resize this to move text around. So im looking for the script to go over the documents on the book and alert the page(s) where the the main text (which is on layer 1, ignoring the image/table frame on layer 2) has been resized. Please take a look at the image attached.

                           

                          frame.jpg

                           

                          -CharlesD

                          • 10. Re: [JS][CS4]Look for Resized frames
                            Trevorׅ Adobe Community Professional

                            Hi Charles,

                             

                            Ingnoring the layers issue for now, I don't know why you are getting the parentPage problem.

                             

                            1)     What happens if you leave out the parent page bit, i.e. change line

                             

                            textFramesDetails.push("TextFrame["+tf[tfl].id+"]"+"  on Page " + tf[tfl].parentPage.name+ "\r")
                            

                            to

                             

                            textFramesDetails.push("TextFrame["+tf[tfl].id+"]"+"  on Page I don't know for now!" + "\r")
                            

                             

                            2)     Does the basic script work (works for me eitherway) ?

                            3)     Can't see why it should make a difference with this issue but what cs do you have?

                            4)     Does the script work on another test document ?

                             

                            Waiting to hear,

                             

                            Trevor

                            • 11. Re: [JS][CS4]Look for Resized frames
                              Trevorׅ Adobe Community Professional

                              One more point to simplify the script, I gather that all the pages have the same margins, is that correct?

                              • 12. Re: [JS][CS4]Look for Resized frames
                                Trevorׅ Adobe Community Professional

                                Try this simplified version

                                That deals with the layers

                                 

                                 

                                // Script by Trevor to show Bad Text Frames http://forums.adobe.com/thread/1089938
                                // Open JS console on ESTK
                                #target indesign
                                #targetengine Trevor
                                app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.FAST_ENTIRE_SCRIPT, "Highlight Bad Text Frames");
                                
                                function main()
                                {
                                var  doc = app.activeDocument,
                                        pl = doc.pages.length,
                                        badTextFrames = [],  textFramesDetails = [],
                                        myXMLViewPreferences = doc.xmlViewPreferences;
                                        myXMLViewPreferences.showAttributes = true;
                                        myXMLViewPreferences.showStructure = true;
                                        myXMLViewPreferences.showTaggedFrames = true;
                                
                                
                                    var pm=doc.pages[0].marginPreferences,
                                    pmTop = pm.top, pmBot = pm.bottom, pmLeft = pm.left, pmRight = pm.right
                                    pb = doc.pages[0].bounds,
                                    tf = doc.layers[0].textFrames, // Change to correct layer
                                    tfl = tf.length,
                                    pb[0] += pmTop, pb[1] += pmLeft, pb[2] -= pmBot, pb[3] -= pmRight;
                                
                                    while (tfl--)
                                        {
                                            var tfGeo = tf[tfl].geometricBounds;
                                            if (tfGeo.toString() != pb.toString()) 
                                                {
                                                    badTextFrames.push(tf[tfl]);
                                                 }
                                         }
                                    
                                var btfl = badTextFrames.length;
                                while (btfl--) 
                                    {
                                        $.writeln(textFramesDetails[btfl] + " is BAD (:-(");
                                        xmlTag (badTextFrames[btfl]); // Delete this line if you don't want to tag
                                     }
                                
                                
                                function xmlTag(objectToTag)
                                      {
                                        if (objectToTag.associatedXMLElement==null) xmlFrame = doc.xmlElements [0].xmlElements.add ("Bad_Frame" , objectToTag);
                                        else
                                           {
                                               objectToTag.associatedXMLElement.untag();
                                               xmlFrame =doc.xmlElements [0].xmlElements.add ("Bad_Frame" , objectToTag);
                                            }
                                        }
                                }
                                
                                • 13. Re: [JS][CS4]Look for Resized frames
                                  Jump_Over Level 5

                                  Hi Charles,

                                  Hi Trevor

                                   

                                  This is my solution:

                                   

                                  ____________

                                  myDoc = app.activeDocument;

                                   

                                  myRu = myDoc.viewPreferences.rulerOrigin;     //edited later

                                  myDoc.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;     //edited later

                                   

                                  layer = myDoc.layers.item(1); // modify if needed

                                  deep = 2;                              // modify if needed

                                   

                                  for (var i = 0 ; i < myDoc.pages.length; i++)

                                      if( !compareBounds(myDoc.pages[i], layer) )

                                          alert ("Frame resized on page: " + myDoc.pages[i].name);

                                   

                                  myDoc.viewPreferences.rulerOrigin = myRu;     // edited later

                                   

                                  function compareBounds (page, layer) {

                                      var frame, k, r, PCompBounds, Fbounds, myRes = false;

                                      for (k = 0; k < page.textFrames.length; k++)

                                          if (page.textFrames[k].itemLayer == layer)

                                              frame = page.textFrames[k];

                                      PCompBounds = frame.overriddenMasterPageItem.geometricBounds;

                                      Fbounds = frame.geometricBounds;

                                      for (r = 0; r < 4; r++) {

                                          PCompBounds[r] = round (PCompBounds[r], deep);

                                          Fbounds[r] = round (Fbounds[r], deep);

                                          }

                                      if (Fbounds.toString() == PCompBounds.toString() )

                                          myRes = true;

                                   

                                      return myRes;

                                      }

                                   

                                  function round (number, deep) {

                                      var deep = parseInt(deep)*10;

                                      var number = Number(number)*deep;

                                      var myRes = Math.round(number)/deep;

                                      return myRes;

                                      }

                                  ___________

                                   

                                  What is assumed:

                                  1. Your target "Base" layer is second layer in myDoc (modify if needed);

                                  2. Your primary text boxes came from masterPage;

                                  3. GeoBounds are rounded to "deep" decimal places;

                                  4. Primary text box size is compared to its masterPage parent item GeoBounds.

                                   

                                  To round GeoBound is needed, I guess, since comparing .toString() could give a small differences on 8-9 decimal place.

                                   

                                  hope...

                                   

                                  Message was edited by: Jump_Over

                                  1 person found this helpful
                                  • 14. Re: [JS][CS4]Look for Resized frames
                                    Laubender Adobe Community Professional & MVP

                                    I don't know why you are getting the parentPage problem.

                                    @Trevor – recently at the InDesign scripting forum at www.hilfdirselbst.ch, Hans Haesler pointed to a case where "parentPage" throws an error considering the textContainer object.

                                     

                                    The following case (TextOnPath_TextFrame.png):

                                     

                                    TextOnPath_TextFrame.png

                                     

                                    If you ask the TextFrame itself, there is no problem with "parentPage":

                                     

                                    app.selection[0].parentPage.name; //=> In my case it's on page one, so the result is the String "1".
                                    

                                     

                                    If you go through the stories and address the "textContainer" objects of the all stories, you get stuck with "parentPage", if you check the "parentPage" of the Story that holds text on the path:

                                     

                                    app.documents[0].stories[1].textContainers[0].parentPage.name; //stories[1] is the story of the text on path
                                    
                                    //Result in my German ESTK: "Objekt unterstützt Eigenschaft oder Methode parentPage nicht"
                                    //translates to: "Object does not support property or method parentPage"
                                    

                                     

                                    Wheras in my example (there is only one text frame) if you ask:

                                     

                                    app.documents[0].stories[0].textContainers[0].parentPage.name;
                                    //Result: 1
                                    

                                     

                                    If you get the message "Object does not support property or method parentPage" you have to work out a fallback method to ask for the parent of the textContainer, if the constructor name of the textContainer is not a TextFrame, but a TextPath object.

                                     

                                    This is a problem even if you can see no text at all. Remember a Story could have contents == ""

                                    A click with the wrong tool (Type on a Path Tool) to a text frame could yield into  that empty story.

                                     

                                    See the blog post (in German):

                                     

                                    Eine 'parentPage'-Falle

                                    (Trapped by "parentPage")

                                     

                                    by Hans Haesler

                                     

                                    http://www.hilfdirselbst.ch/gforum/gforum.cgi?post=503400#503400

                                     


                                    Hope that helps,
                                    Uwe

                                    • 15. Re: [JS][CS4]Look for Resized frames
                                      [Jongware] Most Valuable Participant

                                      >I don't know why you are getting the parentPage problem.

                                       

                                      Look at the post's title.  

                                      • 16. Re: [JS][CS4]Look for Resized frames
                                        Laubender Adobe Community Professional & MVP

                                        @Jongware – yeah, I know.

                                         

                                        I did not read and followed every line of code suggested here. Just pointed out to a problem that might occur, if you address the text frames as textContainer of a Story object instead of directly as a textFrame object.

                                         

                                        Sorry…

                                         

                                        Uwe

                                        • 17. Re: [JS][CS4]Look for Resized frames
                                          Trevorׅ Adobe Community Professional

                                          Hi All,

                                           

                                          Jumpover:

                                          Your code seems to work for me (but then again so did mine!)

                                          Presuming Charles's work flow is how you presume that may well be the correct solution.

                                          The big question is will the client accept a .00000001 difference (will he ever notice ?)

                                          The "fancy" bits of my code came from my script at the bottom of the post on overridden master frame items.

                                          http://forums.adobe.com/message/4599344#4599344

                                          That script or Marijan's one might well be useful to Charles.

                                           

                                          Uwe:

                                          Thanks for the info.

                                           

                                          Jongware:

                                          Thanks for the clarification of Uwe's info.

                                           

                                          All:

                                          Might last script dosn't take into account the difference between the left and right page bounds, pretty dumb but shouldn't be to tough to correct.

                                           

                                          Trevor

                                           

                                          P.s. Any other ideas on the parent page error that I can't duplicate?

                                          • 18. Re: [JS][CS4]Look for Resized frames
                                            Jump_Over Level 5

                                            Hi,

                                            @Trevor

                                             

                                            1. Notice that pb values depends on rulerOrigin set. RulerOrigin.PAGE_ORIGIN differ then RulerOrigin.SPREAD_ORIGIN

                                            2. Notice that if facingPages == true left margin become right on odd pages (and vice versa)

                                             

                                            According to parentPage error - if some of textFrame (script iterates through all of them) is on pasteboard area, this gives an error "null is not a object" for parentPage property ==> so maybe this is a reason.

                                             

                                            rgds

                                            • 19. Re: [JS][CS4]Look for Resized frames
                                              Trevorׅ Adobe Community Professional

                                              Hi Jump Over,

                                               

                                              Regarding points 1 & 2 I'll have to think about them after I rest, at the moment I'm a complete zombie after a network failure last night and having no luck with getting my printer working

                                               

                                              Regarding the parentPage error both the scripts by #7 & #8 only go through text frames on pages and not one on the pasteboard

                                              Can trigger a parent page error on those 2 scripts? (The last script #12 was put together a bit too quickly and needs more fine (or not so fine) tuning

                                               

                                              Regards

                                              Trevor

                                              • 20. Re: [JS][CS4]Look for Resized frames
                                                [Jongware] Most Valuable Participant

                                                Trevor, CS4 doesn't support "parentPage". See Marc Autret's blog for a replacement function: http://www.indiscripts.com/post/2011/03/indesign-scripting-forum-25-sticky-posts -- it's under "Page and pageitems".

                                                • 21. Re: [JS][CS4]Look for Resized frames
                                                  Trevorׅ Adobe Community Professional

                                                  Jump Over:

                                                  I woke up (quite some time ago) ,  I got your points 1 & 2 now, quite important.  Should be easy to fix up

                                                   

                                                  Jongware:

                                                  I'd give you at least a 95% chance of giving the right reason for the parentPage problem. I hadn't heard of indesign before CS5 came out - a real newbee   and have only picked up on a few of the changes from CS4 via the forum. We'll find out for sure if that's the problem when Charles wakes up and can confirm that he has a pre CS5.

                                                   

                                                  Charles:

                                                  Wake up and confirm that you have pre CS5 Indesign.

                                                   

                                                  Regards to all,

                                                   

                                                  Trevor

                                                  • 22. Re: [JS][CS4]Look for Resized frames
                                                    chrlsdrwn12 Level 1

                                                    Everyone,

                                                    im so sorry for late reply again been caught with something so important...

                                                     

                                                    Hi Trevor,

                                                    I take out the parentPage and the script went through. I just have no idea what happened. And the document has been tagged with XML? Im using InDesign CS4.

                                                     

                                                    Hi JumpOver,

                                                    There has been an error on line 20 of the code "undefined is not an object". Source: PCompBounds...

                                                     

                                                    Thank you all guys for spending time with this. Hope this is useful to someone else like me...

                                                     

                                                    -CharlesD

                                                    • 23. Re: [JS][CS4]Look for Resized frames
                                                      Trevorׅ Adobe Community Professional

                                                      Hi Charles,

                                                       

                                                       

                                                      chrlsdrwn12 wrote:

                                                       

                                                      And the document has been tagged with XML?

                                                      The script tags all the "Bad" frames so you can easily navigate from one bad frame to the next.

                                                       

                                                      ScreenShot090.png

                                                       

                                                      To overcome the page reporting issues use Marc solution, see Jongwares link at #20

                                                      Don't forget to apply the fixes the Jump over noticed #18

                                                      Nothing like having a script handed over on a silver platter.

                                                       

                                                      A different and perhaps a better approach is to either Just simply reset all the text frames on layer 1 to the margins bounds which is very easy to script.

                                                      If you want to see which ones were change you can either tag them as you change them or firstly iterate through all the frames on the level, make an array of their geos then reset to the correct geos, make an array of the new geos, compare the 2 arrays and highlight the differences.  You can even reset the bad frames back to their bad geos using the first array if you want either on a one by one or all at once basis.

                                                       

                                                      Jump over script assumes as he wrote "2. Your primary text boxes came from masterPage;" if they don't then you'll get the error.

                                                       

                                                      If your finished with the thread then you can mark one of the scripts as correct although there seems to be problems with all of them.

                                                       

                                                      Regards

                                                      Trevor

                                                      1 person found this helpful
                                                      • 24. Re: [JS][CS4]Look for Resized frames
                                                        chrlsdrwn12 Level 1

                                                        Thanks everyone. These scripts are very helpful at least i have something to play with and learn a thing or two... I hope this is also helpful for someone out there...