2 Replies Latest reply on Mar 4, 2010 9:57 AM by TestOCM

    Auto Text Import - Easy Way ?

    TestOCM Level 1

      Hi!

       

      I'm wondering if there are any scripts available to import text automatically ?

      I have 3 Boxes they are labeled A,B,C.....  I would like the script to import word files and place them in those Boxes .. 

       

      File A - Goes to box A etc ...

       

      Any tips ?

       

      thank u

        • 1. Re: Auto Text Import - Easy Way ?
          Shonkyin Level 3

          This will helpful for you

           

          var myDoc = app.activeDocument;

          var afile = File("~/Desktop/a.txt")

          var bfile = File("~/Desktop/b.txt")

          var cfile = File("~/Desktop/c.txt")

          if (!afile.exists || !bfile.exists || !cfile.exists)

          {

          alert ("Text file missing...")

          }

          else

          {

          myDoc.textFrames.item("a").parentStory.insertionPoints.item(-1).place(afile);

          myDoc.textFrames.item("b").parentStory.insertionPoints.item(-1).place(bfile);

          myDoc.textFrames.item("c").parentStory.insertionPoints.item(-1).place(cfile);

          }

           

          Shonky

          • 2. Re: Auto Text Import - Easy Way ?
            TestOCM Level 1

            Hello,

             

            Thank you it works like a charm ...

            I stumbled upon two issues ... I'm trying to import text file with random number in front    437865_name.txt

            I did try to use "*"  *_name.txt  but its not working ?

             

            And I did try to import some .gif files ... using that ... I guess it can't be done ?

             

             

            Thank you for your help.