Copy link to clipboard
Copied
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
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now