0
importing data from the text file into the layer--illustrator
Contributor
,
/t5/illustrator-discussions/importing-data-from-the-text-file-into-the-layer-illustrator/td-p/11287884
Jul 14, 2020
Jul 14, 2020
Copy link to clipboard
Copied
Hi everyone,
I need a script to add the data from the seperate text file to the respective layer of illustrator file.
TOPICS
Scripting
,
SDK
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explore related tutorials & articles
Guide
,
/t5/illustrator-discussions/importing-data-from-the-text-file-into-the-layer-illustrator/m-p/11287972#M185592
Jul 14, 2020
Jul 14, 2020
Copy link to clipboard
Copied
Your question is very nonspecific, but here are the basic steps: (1) read a file and (2) add the text to a layer (in this case, as area type). (Replace "..." with the address to your file name.)
var address1 = "/C/Users/.../yourFileName.txt"; var file1 = new File(address1); file1.open("e"); var contents1 = file1.read(); file1.close();
var doc1 = app.activeDocument; var layer1 = doc1.layers.add(); var path1 = layer1.pathItems.rectangle(0, 0, doc1.width, doc1.height); var text1 = activeDocument.textFrames.areaText(path1); text1.contents = contents1;
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Rocky@
AUTHOR
Contributor
,
LATEST
/t5/illustrator-discussions/importing-data-from-the-text-file-into-the-layer-illustrator/m-p/11289015#M185635
Jul 15, 2020
Jul 15, 2020
Copy link to clipboard
Copied
Thanks femkeblanco,
Sorry for not mentioned in detail.
I need a code to update the data into the layer(eg., test) of the active document of illustrator. But the data from the text file was called by apple script and append through javascript. I dont need call directly from javascript.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

