Copy link to clipboard
Copied
Hi everyone ,
Is there code available to collect the font, link and color names in the active document and not the duplicate of same color or image instead of for example
Link,
Link-1 used in the active document 3 times means the script will find the length and put with the name like
Link-1 (3)
Hm. Just noticed that you tagged your question with "SDK". Is there a particular reason?
My answer's code is written in ExtendScript (JavaScript).
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
To get an array of used fonts in a document you can do:
app.documents[0].fonts.everyItem().getElements();
To get all links in the same document the code is similar:
app.documents[0].links.everyItem().getElements();
The resulting array contains font objects, respectively link objects.
You could loop the arrays to get all relevant properties and values if you like.
Check the DOM documentation for the objects and property/value pairs:
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Font.html
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Link.html
Or, you could use the collection of fonts like that and get an array of name values:
app.documents[0].fonts.everyItem().name;
The same with the links:
app.documents[0].links.everyItem().name;
FWIW: If you do this with the colors collection of the document, notice, that not every color has a name.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Hm. Just noticed that you tagged your question with "SDK". Is there a particular reason?
My answer's code is written in ExtendScript (JavaScript).
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Thanks Laubender,
Actually, it may available in plugin also good thats is the reason