Copy link to clipboard
Copied
Can I use an external library such as markerjs to add annotations in a created layer using extendedscript?. If yes can you point me to the documention where I can get a gist of how to implement it.
Also, the included code would have to be written with the InDesign ExtendScript API, so I don’t think the web markerjs library you linked to is going to work with Adobe apps.
Copy link to clipboard
Copied
Hi @parthivs86032685 , Try using the .jsxinc extension for the external file and save it to the same directory as the script that includes the .jsxinc file. Then at the top of your script ad #include "YourLibName.jsxinc". For eample this for external code named HelloWorld.jsxinc:
/**
* External function example saved with .jsxinc in the same directory as script
* @ param s string
* @ return new string
*/
function helloWorld(s){
return "From Hello World: " + s
}
And in the same directory a script calling the helloWorld() method from the .jsxinc file:
#include "HelloWorld.jsxinc"
alert(helloWorld("Hi There!"))
Run from ID:
Copy link to clipboard
Copied
Hi @rob day,
Any specific reason to use the jsxinc extension, I think any extension would work like jsx and js.
@parthivs86032685 as mentioned previously, you can use any external library you want the only cavaet being that it is compatible with the ECMAScript 3 as this is what extendscript uses.
-Manan
Copy link to clipboard
Copied
Hi Manan, I did not check if .jsx will also work, but there’s this reference
https://extendscript.docsforadobe.dev/extendscript-tools-features/preprocessor-directives.html
Copy link to clipboard
Copied
That's what that document says, but in fact, as Maman mentioned, it can be any file extension.
Copy link to clipboard
Copied
Also, the included code would have to be written with the InDesign ExtendScript API, so I don’t think the web markerjs library you linked to is going to work with Adobe apps.
Copy link to clipboard
Copied
"Add image annotation functionality to your web apps with the ultimate image annotation library - marker.js 2." - so absolutely not.