Skip to main content
scottr12917177
Inspiring
October 26, 2018
Question

Accessing the Creative Cloud Libraries objects by script?

  • October 26, 2018
  • 2 replies
  • 3747 views

I have been scripting Adobe products for a few years, and I am utterly confused how to access the "Creative Cloud Libraries" through script? Are there any docs on how to get references to the objects? I would like to access my "Creative Cloud Libraries" by name, and access all the assets in that "Creative Cloud Libraries"?

Curious to know if anyone has figured out how to access the "Creative Cloud Libraries" through script?

Thanks!

Scott

This topic has been closed for replies.

2 replies

scottr12917177
Inspiring
November 7, 2018

Thanks CarlosCanto​ and Silly-V​ here is what I came up with to find a client CC Library by name, and return the .ai files.

I will send the array of returned .ai files and run them through a batch exporter I wrote that will generate a folder with sub-folders for each type; png, svg, etc.

function getLibraryFiles( libName ){

    var fldrs_localCClibraries =  Folder( Folder.userData+'/Adobe/Creative Cloud Libraries/LIBS/'+app.userGUID.replace('@AdobeID','') +'_AdobeID/creative_cloud/dcx/').getFiles();

   

    for( var g = 0; g < fldrs_localCClibraries.length; g++) {

        var localLibraryFiles = fldrs_localCClibraries.getFiles();

        var localLibraryComponentFiles = null;

           

        // does the manifest file in this library folder contain the library name I'm looking for

        for( var h = 0; h < localLibraryFiles.length; h++) {

            // locate manifest file in library folder

            if( localLibraryFiles.displayName == 'manifest' ){

               

                localLibraryFiles.open('r');  // open manifest file

                var txt_manifest = localLibraryFiles.read(); // read all contents in manifest file

                localLibraryFiles.close(); // close the manifest file

               

                if( txt_manifest.indexOf(libName) != -1 ) { // does manifest file contain library name user is looking for

                      

                    var thisLibraryFolder = fldrs_localCClibraries.getFiles();

                   

                    for( var t = 0; t < thisLibraryFolder.length; t++) { // find component folder in library

                        if( thisLibraryFolder.name == 'components' ) {

                            return thisLibraryFolder.getFiles( '*.ai' );  // get all .ai files in component folder

                        }

                    } // for all files in library folder

                }

            }

        } // for all files in a library folder

    } // for all library folders

    return null;

}

//end

CarlosCanto
Community Expert
Community Expert
November 7, 2018

Hi scott, haven't tried it yet, but thanks for sharing

Silly-V
Legend
October 26, 2018

Try to do some experiments with

Application.openCloudLibraryAssetForEditing (assetURL: File , thumbnailURL: File , assetType: string , options:any): Document

Adobe Illustrator 23 Type Library

For Internal Use.

assetURL: Data Type: File

For Internal use.

thumbnailURL: Data Type: File

For Internal use.

assetType: Data Type: string

For internal use.

options (optional): Data Type: any

For internal use.

scottr12917177
Inspiring
November 5, 2018

Silly-V​ have you messed around with accessing the content in the CC Libraries through script?

We have a shared CC Library "NI Visual Assets" with commonly used icon metaphors for the visual design team. From what I can tell, the icons are saved in the CC Library as a .AI.

What I want to do, is drop each .AI icon metaphor into a new document, then export as .SVG. The only component I am missing is gaining access to the .AI icon by script?

I looked into the app.openCloudLibraryAssetForEditing(myAsset,myAsset) but unsure how to query each .AI file in the "NI Visual Assets" CC library.

Interested in hearing if the community has attempt something like this,

Scott

CarlosCanto
Community Expert
Community Expert
November 5, 2018

check this thread by quertyfly, and the link to a previous thread as well

Re: scripting with cc libraries ?