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

Call IDJS script from HTML file

Explorer ,
Aug 07, 2023 Aug 07, 2023

Copy link to clipboard

Copied

Dear All,

 

We are planning to do to create a HTML page  (like a web Page).  we will list out our all tools in that page. Based on that, will select any one of the tool from the HTML Page (web page). We will try to call the Script into InDesign through IDJS. 

 

Is that possible to do that.? Can any one help me on this how to call the IDJS.

 

We tried but no responce from InDEsign. 

 

Kindly help me any one will appriciate...

 

 

Thanks & Regards

Harihara sudhan T R.,

TOPICS
Scripting , Type , UXP Scripting

Views

609

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
People's Champ ,
Aug 07, 2023 Aug 07, 2023

Copy link to clipboard

Copied

I might be wrong but I don't think you can by the sole construction of an idjs script from an HTML Page. idjs scripts will basically be executed on demand (typically by the user). So your puzzle is missing a piece, i.e. a listener that reacts from the html call and run something.

What you can do at the moment is:

- Wait for UXP plugins and see if they offer some kind of "webhook" that you can use to activate the idjs script on demand.

- Work with CEP plugins. Those can easily set a webhook. But those work typically with ExtendScript. So you could either work with ExtendScript scripts, or have one that will run the idjs script (but the latter I never tried).

- Have some process of yours that catches requests and run InDesign from command line: https://stackoverflow.com/questions/37320580/how-to-execute-an-indesign-extendscript-from-command-li... but I am not sure that can work with idjs file (nor the whole thing to be frankly honest).

- Use some whatever code (VB?) that both can receive http requests and drive InDesign.

 

My personal take at the moment would be the CEP plugin. But be aware you are at legal risk here. If the person that clicks on the HTML page that runs the idjs script is not the InDesign License owner, you are infringing Adobe InDesign's EULA. Or you need InDesign Server.

Votes

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
People's Champ ,
Aug 07, 2023 Aug 07, 2023

Copy link to clipboard

Copied

Also, could have mentioned this:

https://coppieters.nz/?p=549
never used myself and legal concers remain 

Votes

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
Participant ,
Aug 07, 2023 Aug 07, 2023

Copy link to clipboard

Copied

In theory you can build jsx and run it from python. At least 10 years ago it worked. On windows.

import win32com.client
from win32com.client import Dispatch

app = win32com.client.dynamic.Dispatch('Indesign.Application')

def foo(param):
    app.DoScript(' some jsx code to which you can pass a parameter like param = % ' % param,1246973031)

  

Votes

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
Contributor ,
Aug 07, 2023 Aug 07, 2023

Copy link to clipboard

Copied

It sounds like you are just trying to make a panel for indesign since they are based in html? If so, this is basically what a UXP or CEP plugin does. From my experience CEP plugins will not run IDJS scripts. With the UXP plugin, it should be the same code, it just does not need to be called an idjs. You can just call it a js. If you are trying to run it from a web browser onto the same computer, write a plugin instead. If you are trying to run it through a web browser on another computer, that does not sound legal.

Votes

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
Explorer ,
Aug 07, 2023 Aug 07, 2023

Copy link to clipboard

Copied

Well, you can technically call idjs from CEP but I agree that the main concern is legal.

idjs_cep.gif

 

 

Votes

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
Contributor ,
Aug 24, 2023 Aug 24, 2023

Copy link to clipboard

Copied

LATEST

Where your HTML Page will be loaded -

 

1. Is it Web Browser ?

2. CEP Panel 

3. UXP 

 

If it is CEP or UXP then it should be a straight forward task as these UI is loaded by InDesign and your scripts will work.

 

But if your HTML is loaded on web browser then there is no way you can run InDesign Scripts. This is because of security reasons of web browser and you can't access other system files/programs.

 

But still there is a workaround but that will require more work -

 

1. Create InDesign C++ Plugin that exposes REST API.

2. Then from the web browser, you can call InDesign REST API and passing the script and C++ Plugin can execute your script.

3. Only drawback is that you can't launch InDesign from web browser. But atleast, you will be able to detect if InDesign is running or not by calling REST API.

 

 

 

Votes

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