Highlighted

CC Libraries in javascript

Community Beginner ,
Sep 15, 2020

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?

TOPICS
Scripting

Views

76

Likes

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

CC Libraries in javascript

Community Beginner ,
Sep 15, 2020

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?

TOPICS
Scripting

Views

77

Likes

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
Sep 15, 2020 0
Adobe Community Professional ,
Sep 15, 2020

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 )

Likes

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
Reply
Loading...
Sep 15, 2020 0
Community Beginner ,
Sep 15, 2020

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?

Likes

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
Reply
Loading...
Sep 15, 2020 0
Adobe Community Professional ,
Sep 15, 2020

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 )

Likes

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
Reply
Loading...
Sep 15, 2020 0