Photoshop script: Possible to load images from CC library?
Copy link to clipboard
Copied
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
Explore related tutorials & articles
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thanks for the info, JJ. I'll give it a try.
Michael
_____________
Michael Niessen - Photographer, photo-editor, educator
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I think that nothing will work out - it is almost impossible to interact with the new UXP panels using scripts.
Copy link to clipboard
Copied
I guess I'll have to save all those images in a folder locally and load them from there, then. That is possible, isn't it?
Michael
_____________
Michael Niessen - Photographer, photo-editor, educator

