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

Indesign Javascript for server and Desktop

Community Beginner ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

Dear All,

 

Please suggest me how can make same Javascript run server as well on Desktop 

- Any Plugin?

- Any Idea?

 

Both will have same javascript code server and Desktop,

if there is some posibility please tell me,

 

Thanking you,

Abhishek

TOPICS
Scripting , SDK

Views

332

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 2 Correct answers

Community Expert , Dec 04, 2020 Dec 04, 2020

Hi,

 

Just to add my 2 cents to above, if you have a think about the feature you are implementing or want to use in your code, if it has a User Interface element, then it (probably) wont work in Server.

 

This is a general rule of thumb that has served me well over the years, most things that can be done via the UI can be done in another manner via scripting.

 

Malcolm

Votes

Translate

Translate
Community Expert , Dec 08, 2020 Dec 08, 2020

Hi Abhishek,

on this page of the late Theunis de Jong ( Jongware ) you still can find a DOM description of old InDesign Server CS6 ( version 8 ) that could be a starting point: http://www.jongware.com/idjshelp.html

 

Regards,
Uwe Laubender

( ACP )

Votes

Translate

Translate
Community Expert ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

Hello Abhishek,

The JS is designed to work for both the desktop as well as the server version of InDesign you don't need to do anything special to make it compatible with both except making sure that your code does not refer object/properties that are available just for one version. For ex. to get a reference to the current document you can use the following two pieces of code

app.activeDocument
app.documents[0]

However, only the second statement would work on both server and desktop while the first will work on desktop only. Such things are few and far between which you can easily resolve by executing your script and see if it errors out on any DOM call, if it does refer to the documentation and you will get the solution

-Manan

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
Community Expert ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

Hi,

 

Just to add my 2 cents to above, if you have a think about the feature you are implementing or want to use in your code, if it has a User Interface element, then it (probably) wont work in Server.

 

This is a general rule of thumb that has served me well over the years, most things that can be done via the UI can be done in another manner via scripting.

 

Malcolm

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
Community Expert ,
Dec 08, 2020 Dec 08, 2020

Copy link to clipboard

Copied

LATEST

Hi Abhishek,

on this page of the late Theunis de Jong ( Jongware ) you still can find a DOM description of old InDesign Server CS6 ( version 8 ) that could be a starting point: http://www.jongware.com/idjshelp.html

 

Regards,
Uwe Laubender

( ACP )

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