Skip to main content
fredericg91066745
Known Participant
February 17, 2021
Question

Extendscript: Place asset from Shared Adobe CC library

  • February 17, 2021
  • 3 replies
  • 752 views

Hello,

 

Is is possible to place an asset (jpg) from a Shared Adobe CC library on a PSD layer with jsx code?

 

I tried to link directly to the online library:

 
I tried to link to the local copy of the asset:
var assetFile = new File('/Users/xxx/Library/Application Support/Adobe/Creative Cloud Libraries/LIBS/xxx_AdobeID/creative_cloud/xxx/xxx-c5ae61c21adf/components/asset.jpg')
 
.. but no succes 😞

Thanks,

fred

 

This topic has been closed for replies.

3 replies

rob day
Community Expert
Community Expert
February 25, 2021

I don’t think it will work because when you place a Library asset a temporary copy is downloaded from the cloud library for the local place. On OSX the download is deep inside of the hidden private folder. The file is deleted on a restart—as @Lumigraphics suggests I don’t think there would be a way to even get the temp file path without downloading first. Here’s the file when I choose Edit Contents from the Layers panel:

 

 

This came up in the InDesign forum today:

https://community.adobe.com/t5/indesign/script-to-relink-all-image-from-local-to-cc-library/td-p/11854626

 

fredericg91066745
Known Participant
February 26, 2021

Thanks everyone for your help 🙂

I think that for now since I don't have many assets, I will relink manually each one to the Adobe CC Library.

fred

Legend
February 17, 2021

This is not likely to work. You'll need to download the asset first.

fredericg91066745
Known Participant
February 22, 2021

Hello,

Thank you all for your help. Here is where I am so far:

Using the ScriptingListenerJS, I am able to retrieve le path to the asset in my local computer. Unfortunately, the name I need to place the asset on the PSD is not "b73bfca4-352b-4173-b53f-f3bf96382daf.jpg" but "RDV_843.jpg" ... In another word, how can I get the real name to do this:

 

new File( "/Users/fred/Library/Application Support/Adobe/Creative Cloud Libraries/LIBS/0509FD58579F38307F000101_AdobeID/creative_cloud/dcx/da4c9e1a-8bc8-4966-8ae1-c5ae61c21adf/components/RDV_843.jpg" ) );

 

 

var idplaceEvent = stringIDToTypeID( "placeEvent" );
var desc6 = new ActionDescriptor();
var idID = stringIDToTypeID( "ID" );
desc6.putInteger( idID, 2 );
var idnull = stringIDToTypeID( "null" );
desc6.putPath( idnull, new File( "/Users/fred/Library/Application Support/Adobe/Creative Cloud Libraries/LIBS/0509FD58579F38307F000101_AdobeID/creative_cloud/dcx/da4c9e1a-8bc8-4966-8ae1-c5ae61c21adf/components/b73bfca4-352b-4173-b53f-f3bf96382daf.jpg" ) );
var idlayerName = stringIDToTypeID( "layerName" );
desc6.putString( idlayerName, """RDV_843""" );
var idlinked = stringIDToTypeID( "linked" );
desc6.putBoolean( idlinked, true );

JJMack
Community Expert
Community Expert
February 22, 2021

b73bfca4-352b-4173-b53f-f3bf96382daf

That sreing looks like a UUID a script mat have generated to ceate a unique name fot that jpeg file. The folder name da4c9e1a-8bc8-4966-8ae1-c5ae61c21adf also look liks a UUID

JJMack
JJMack
Community Expert
Community Expert
February 17, 2021

 

so 

var appData = Folder.userData;

the var appData may work on both PC and Mac for the beginning of the path.  I do not use Cloud libraries so I do not know where  local library copy may be.

 

var assetFile = new File(appData +  '/Adobe/Creative Cloud Libraries/LIBS/xxx_AdobeID/creative_cloud/xxx/xxx-c5ae61c21adf/components/asset.jpg')

JJMack