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

Thread Text Frames by Name

Return to Member Forum

  • Author
    Posts
    • #1242856

      Hi all! Hope you are all safe and well!

      Would appreciate some help with a script. I have a document with many text frames with object styles. I’m looking for a script that will thread text frames that have the same object style name. When new pages are added to the document then the script could be run to link the newly created frames.

      I haven’t found any discussion on this so far, it should be possible right? There were discussion on threading text boxes and also on Finding objects with the same name (https://indesignsecrets.com/reply/finding-objects-of-particular-object-style-28-78) But I have no idea how to combine them ?

      Thanks

    • #1242862

      Thank you Theunis De Jong! Finally succeeded in combining your 2 scripts. I don’t know if there will be any hiccups but for now it runs!… :D

      var combineMe = new Array;

      app.findObjectPreferences = null;
      app.findObjectPreferences.appliedObjectStyles = “text”;
      found_list = app.activeDocument.findObject(true);
      for (a=0; a<found_list.length; a++)
      {
      if (found_list[a] instanceof TextFrame)
      combineMe.push(found_list[a]);
      }
      combineMe.sort (function (a,b) { return (a.geometricBounds[0] < b.geometricBounds[0]) || (a.geometricBounds[0] == b.geometricBounds[0] && a.geometricBounds[1] < b.geometricBounds[1]) ? -1 : 1; } );

      for (i=0; i<combineMe.length-1; i++)
      {
      if (combineMe[i].nextTextFrame == null)
      {
      nextFree = i+1;
      while (nextFree < combineMe.length && combineMe[nextFree].previousTextFrame != null)
      nextFree++;
      combineMe[i].nextTextFrame = combineMe[nextFree];
      }
      }

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
Forum Ads