Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

201
Vistas
Is it possible to read MS Document or Excel in indesign script?

I have following code. My script can read external file liken(txt) and place it to InDesign file but if I try to change .txt --> .doc I get some weird characters It looks like .js or .jsx doesn't know to read it What I can do in this case?

this works

var variable ="hello world"

var doc = app.activeDocument;
var titleTextFrame = doc.textFrames.add(); 
titleTextFrame.contents = variable; 
titleTextFrame.geometricBounds = [20, 80, 80, 150]; 


    var inputFile = File("~/Desktop/text.txt");
    
    var inputData;
    inputFile.open("r");
    inputData = inputFile.read().toString();
    inputFile.close();
    
  
alert(inputData);

var textLorem = doc.textFrames.add();
textLorem.contents = inputData; 
textLorem.geometricBounds = [30, 80, 80, 150];  

this doesn't work

 var inputFile = File("~/Desktop/text.doc");
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you want to place files like DOC, etc you have to use method place(file):

var variable ="hello world"

var doc = app.activeDocument;
var titleTextFrame = doc.textFrames.add();
titleTextFrame.contents = variable;
titleTextFrame.geometricBounds = [20, 80, 80, 150];

var inputFile = File("~/Desktop/text.doc");

var textLorem = doc.textFrames.add();
textLorem.geometricBounds = [30, 80, 80, 150];
textLorem.place(inputFile);       // <-------------------- here

It doesn't make sense to read DOC files directly with file.read() method.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda