Copy link to clipboard
Copied
Hi there,
I am trying to grab swatch colors created for our company in our libraries in javascript. We have several CC Libraries on file. so I am trying to grab the name of the library. Then we have groups for logos, colors, etc. so I am trying to get into a named group, then that asset color name.
I haven't' got past
var brandLib = app.libraries.itemByName("Library Name");
var brandLib.assets.itemByName("Color Name");
if (!brandLib.isValid || !brandLib.assets.length) {
alert("No Library Found");
exit();
}
else {
alert("Add Item");
}
when I run this nothing happens. I am following what others said to try, but it is not working.
any ideas?
Copy link to clipboard
Copied
Hi kyleo,
no wonder that you couldn't get anything.
app.libraries is pointing at opened InDesign library files ( *.indl ) and not to CC Library libraries.
There is no DOM object that can reach assets inside CC Libraries.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
okay, that makes sense why everything I have tried is not working. is there a way I can link to the online library on our company account to use?
Copy link to clipboard
Copied
Sorry. As I already said: I see no way.*
If you find something somewhere else, please come back and share the trick.
* There are some methods with the application in InDesign 2020 that are looking promising, but if you see into the details what to provide as argument you will be on your own. One example:
app.openCloudAssetForEdit()
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Application.html#d1e42173__d1e47549
Thanks,
Uwe Laubender
( ACP )