Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

197
Views
¿Es posible leer MS Document o Excel en el script de diseño?

Tengo el siguiente código. Mi secuencia de comandos puede leer un archivo externo similar (txt) y colocarlo en un archivo de InDesign, pero si trato de cambiar .txt --> .doc obtengo algunos caracteres extraños. Parece que .js o .jsx no sabe leerlo. Qué que puedo hacer en este caso?

esto funciona

 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];

esto no funciona

 var inputFile = File("~/Desktop/text.doc");
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Si desea colocar archivos como DOC, etc., debe usar el método 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

No tiene sentido leer archivos DOC directamente con el método file.read() .

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!