Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Auto Text Import - Easy Way ?

New Here ,
Mar 03, 2010 Mar 03, 2010

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

TOPICS
Scripting
442
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Mar 03, 2010 Mar 03, 2010

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

Translate
Engaged ,
Mar 03, 2010 Mar 03, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 04, 2010 Mar 04, 2010
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines