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

importing data from the text file into the layer--illustrator

Contributor ,
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

Views

377
Translate

Report

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
Adobe
Guide ,
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;

 

Votes

Translate

Report

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
Contributor ,
Jul 15, 2020 Jul 15, 2020

Copy link to clipboard

Copied

LATEST

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.

 

 

 

Votes

Translate

Report

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