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
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
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 )
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
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
Copy link to clipboard
Copied
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 )