2 Replies Latest reply on Feb 13, 2009 12:29 PM by Seth McGraw

    Script Labels w/ Event Listeners

    Seth McGraw Level 1
      javascript -
      There is now a working session event listener to time stamp a doc in a specific location in a text box on save.

      When that type of template is not open however (when working a different kind of job) indesign errors because the label (text box) isn't there.

      How can I call on the label to stop the event listener when a specific template type is not being used? It now tries to stamp all docs because the session is still open, and indesign has to be restarted. If we change workflows, I don't need the timestamp.

      I wish there were a way to get to the document level instead of the session.
      Any ideas on how to say in script "if the doc doesn't have this specific text box in this location, bypass the listener?"

        • 1. Re: Script Labels w/ Event Listeners
          Level 1
          myTextFrame = myDoc.textFrames.itemByName("LabelMe");
          if (myTextFrame != null) {
          // do your thing
          • 2. Re: Script Labels w/ Event Listeners
            Seth McGraw Level 1
            I'll check that out. Thanks

            Because the session listener is in the production script, it stacks everytime that script is run, creating a confirmation for each iteration of the script cycle.
            The time stamp displays a confirmation everytime the script is run.

            I only want the time stamp to happen when the document is closed. On save was a comprimise. Any idea on how to accomplish this?

            Also in a different scenario I would like to call on another script from within a script. How do you run a script from a script?