4 Replies Latest reply on Sep 7, 2010 7:57 AM by Harbs.

    Scripting Question?

    mcm_art Level 1

      Hello,

        Complicated script question. I don't need it scipted for me or anything i just want to know if this can be done. Can i have a script automatically launched upon opening any document?

       

      Because here is what i need:

       

      1. i have a coupon magazine company with Expiration dates in every document x 1,000 atleast

      2. i have default dates for every issue that they need to be set to. I.E. the previous was 10/01/10, and i need them ALL to change to 11/26/10

      3. i have 4 network drives where all this is accessed by my art department.

       

      So, on the artists client machines, can a script be launched when they open a document from one of the 4 network drives that can change anything reading 10/01/10 to 11/26/10? that way i just have to change the default date in the script once every 2 months. My magazine ships 6 times a year. So i don't have to change the script often, but the repitition of changing over 1000 dates is tedious!!!!  and it needs to be automatic?

       

      or can a plugin be made even?

       

      PLEASE

      can this be done? i have a scripting guy here at my work, i am researching for him.

        • 1. Re: Scripting Question?
          Harbs. Level 6

          Which version of InDesign?

           

          Tell your scripting guy to check out AFTER_OPEN events...

           

          If you don't need to otherwise open the docs, a batch script might be a better option...

           

          Harbs

          1 person found this helpful
          • 2. Re: Scripting Question?
            mcm_art Level 1

            Hi Harbs

              It's for Indesign CS3, moving to CS5 sometime in future. Whats after_open events? Is that a indesign function or like a plugin/addon?

             

             

            The batch has been done for other things, but this has to be done AS we open each document (long explanation haha) through a 2 month process. So batch can' t be used. It has to be opened per document at different times.

             

            Thanks for reply!

            • 3. Re: Scripting Question?
              Harbs. Level 6

              It's possible to add event listeners which run scripts at specific intervals. One of the events is AFTER_OPEN, which fires after a document is opened. The event will run whatever function you attach...

               

              One word of caution:

              AFTER_OPEN runs before the document winodw is opened, so you need to reference the document using app.documents[0] (or the event parent), not app.activeDocument...

               

              Harbs

              http://www.in-tools.com

              Innovations in Automation

              • 4. Re: Scripting Question?
                mcm_art Level 1

                Thanks a million man!

                now my script guy will be able to get a handle this. i think we tried this last year and he ran into the document not open problem haha

                 

                 

                THANKS AGAIN!!