Skip to main content
@MNiessenPhoto
Legend
November 5, 2021
Question

Photoshop script: Possible to load images from CC library?

  • November 5, 2021
  • 1 reply
  • 576 views

Hi,

I'm new to scripting in Photoshop and would like to know if it's possible to load images from one of my CC libraries. I can't find any references to libraries in the scripting guide and so far haven't found anything on the web either.

My goal is to be able to load images from one of my libraries based on a keyword, for example tree. It doesn't really matter if at first tree is hardcoded in the script or if it's possible to write it in a dialog window. Anyway... the script would search my library for images called tree and load a few of them, placing them side by side on the canvas. Running the script would load a random set of results each time I run it.

Is it at all possible?

Any nudge in the right direction would be welcome 😉

Michael

_____________

Michael Niessen - Photographer, photo-editor, educator

This topic has been closed for replies.

1 reply

JJMack
Community Expert
Community Expert
November 5, 2021

I do not use libraries they are new compared to Adobe scripting documentation.  I think you should install the Scriptlistener Plug-in and see what the plug-in logs when you open a library asset into photoshop.

JJMack
@MNiessenPhoto
Legend
November 8, 2021

Thanks for the info, JJ. I'll give it a try.

 

Michael

_____________

Michael Niessen - Photographer, photo-editor, educator

Photo-editing (Ps/Lr/LrC) and photography workshops & one-on-one training (off- and online)
JJMack
Community Expert
Community Expert
November 8, 2021

I open one from the cloud here is what I saw recorded:

 I selected the document from the open dialog UI. 

new File( "C:\\cloud-content\\LO2G5037.psdc" )

I do not know how one would get a list of  files one has in a library.

 

The code

open(false, true, new File( "C:\\cloud-content\\LO2G5037.psdc" ));
function open(dontRecord, forceNotify, null2) {
	var descriptor = new ActionDescriptor();

	descriptor.putBoolean( stringIDToTypeID( "dontRecord" ), dontRecord );
	descriptor.putBoolean( stringIDToTypeID( "forceNotify" ), forceNotify );
	descriptor.putPath( charIDToTypeID( "null" ), null2 );
	descriptor.putInteger( stringIDToTypeID( "documentID" ), 1040 );
	executeAction( stringIDToTypeID( "open" ), descriptor, DialogModes.NO );
}

works to open the cloud  document.

JJMack