Skip to main content
Participant
September 2, 2021
Answered

Run .jsx script on a closed document

  • September 2, 2021
  • 5 replies
  • 1373 views

Hello,

 

Is there any posibillity to run a .jsx script with file path as parameter, outside of indesign (inactive indesign, inactive document) to export this indesign document to html files?

Thnaks in advance!

This topic has been closed for replies.
Correct answer Peter Kahrel

I am not willing to create an .indd parser nor an .idml parser.

In that case you'll have to open InDesign or not run your script.

5 replies

Participant
September 6, 2021

Hello,

 

Thank you all for your replies.

I am not willing to create an .indd parser nor an .idml parser.

 

The only reason I want to run .jsx outside of indesign is to automate the procedure (No need to open indesign file in order to export the file, just click on a button on my custom node.js program).

Peter Kahrel
Community Expert
Peter KahrelCommunity ExpertCorrect answer
Community Expert
September 6, 2021

I am not willing to create an .indd parser nor an .idml parser.

In that case you'll have to open InDesign or not run your script.

Community Expert
September 4, 2021

@Χριστόφορος5F85 wants to convert InDesign file to HTML without the need for InDesign installation, in such a case as mentioned the only feasible and viable option is to start with IDML file rather than an INDD file. The next step would be reading up the IDML specification(readily available), identify which files within the IDML package would contain the information you would need to create your HTML file, then use something like XSL tranformations to parse and transform the source data into the final format.

-Manan

-Manan
Sunil Yadav
Legend
September 6, 2021

Agreed with @Manan Joshi , IDML would be an option without installation of InDesign it can be unzipped as well

& can be read like an XML file. We can achieve required HTML.

 

Sunil

TᴀW
Legend
September 3, 2021

You'd need to write your own .indd file parser, and I think that would be very difficult. I don't think the .indd format is open source.

However, if you could save your documents as .idml, it should be possible. The IDML specification is open source and human-readable. Not saying it's easy, but definitely possible,

Ariel

Visit www.id-extras.com for powerful InDesign scripts that save hours of work — automation, batch tools, and workflow boosters for serious designers.
Peter Kahrel
Community Expert
Community Expert
September 3, 2021

Xristophor wants to run a jsx script outside of InDesign, so my batch converter won't do because it needs InDesign.

As Ariel mentioned, you'd have to parse the indd, which is virtually impossible. Parsing IDML is possible, but not easy.

 

P.

Legend
September 3, 2021

Hello @Χριστόφορος5F85,

 

Take a look at Peter Kahrel's batch convert script in the link below, you'll need to thoroughly read through the documentation to see if it meets your needs.

 

https://creativepro.com/files/kahrel/indesign/batch_convert.html

 

Regards,

Mike

Sunil Yadav
Legend
September 3, 2021

I think Peter Kahrel's batch convert script in the link above would suit the requirement.

If not elaborate the point which OP wants...

 

Best

Sunil

Community Expert
September 2, 2021

What's the operating system?

 

You could run your script from a trusted folder with a #target statement for a specific version of InDesign with a double-click:

 

#target indesign-16.064

 

 

On Windows 10 a trusted folder is the Adobe Scripts folder in the user's Documents folder. If it does not exist create it.

C:\user\USERNAME\Documents\Adobe Scripts\yourExtendScript.jsx

 

Regards,
Uwe Laubender

( ACP )

rob day
Community Expert
Community Expert
September 2, 2021

Hi Uwe, the target line would always launch InDesign right? It wasn’t clear to me if @Χριστόφορος5F85 was trying to export the HTML files without activating ID?

Community Expert
September 3, 2021

Hi Rob,

yes. But a user would be greeted with a security message and question when you double-click the script file somewhere on the hard disk. Run from a trusted folder like the one I described, InDesign would be started and the code executed without a message up front…

 

Regards,
Uwe Laubender

( ACP )