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

Why does grouping or moving textboxes break the script?

Tagged: ,

Return to Member Forum

  • Author
    Posts
    • #73399
      Anonymous
      Inactive

      I am a beginner at writing scripts for InDesign (just started today!). I have somehow managed to write a script which auto-fills a text box with a list of the linked images within the document. However, when I group the text box with other objects or move it to another indesign doc, the script no longer works. I get an error that says “Object is invalid” with the source being “resFrame.contents = res.String;”. Can someone please explain why this is happening and how it can be fixed?

      Code below…

      myDoc = app.activeDocument;
      myPages = myDoc.pages.everyItem().getElements();
      myDoc.viewPreferences.horizontalMeasurementUnits = myDoc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.INCHES;

      for (var k = 0; k < myPages.length; k++) {
      resString = myDoc.links.everyItem().name.join(“\r”);
      resFrame = myFramelinks(myPages[k]);
      resFrame.contents = resString;
      }

      function myFramelinks (page) {
      var mFlinks = page.textFrames.item(“linkslist”);
      return mFlinks;
      }

Viewing 0 reply threads
  • You must be logged in to reply to this topic.
Forum Ads