Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Run .jsx script on a closed document

New Here ,
Sep 02, 2021 Sep 02, 2021

Copy link to clipboard

Copied

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!

TOPICS
Import and export, Scripting

Views

137

Likes

Translate

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

correct answers 1 Correct answer

Adobe Community Professional , Sep 06, 2021 Sep 06, 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.

Likes

Translate

Translate
Adobe Community Professional ,
Sep 02, 2021 Sep 02, 2021

Copy link to clipboard

Copied

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 )

Likes

Translate

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 Community Professional ,
Sep 02, 2021 Sep 02, 2021

Copy link to clipboard

Copied

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?

Likes

Translate

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 Community Professional ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

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 )

Likes

Translate

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
Advocate ,
Sep 02, 2021 Sep 02, 2021

Copy link to clipboard

Copied

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

Likes

Translate

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 Community Professional ,
Sep 02, 2021 Sep 02, 2021

Copy link to clipboard

Copied

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

Likes

Translate

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 Community Professional ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

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

Likes

Translate

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 Community Professional ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

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.

Likes

Translate

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 Community Professional ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

@Χριστόφορος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

Likes

Translate

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 Community Professional ,
Sep 05, 2021 Sep 05, 2021

Copy link to clipboard

Copied

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

Likes

Translate

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
New Here ,
Sep 06, 2021 Sep 06, 2021

Copy link to clipboard

Copied

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).

Likes

Translate

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 Community Professional ,
Sep 06, 2021 Sep 06, 2021

Copy link to clipboard

Copied

LATEST

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.

Likes

Translate

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