• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Photoshop script: Possible to load images from CC library?

Enthusiast ,
Nov 05, 2021 Nov 05, 2021

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

Photo-editing (Ps/Lr/LrC) and photography workshops & one-on-one training (off- and online)
TOPICS
Actions and scripting

Views

201

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
community guidelines
Adobe
Community Expert ,
Nov 05, 2021 Nov 05, 2021

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.

JJMack

Votes

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
community guidelines
Enthusiast ,
Nov 08, 2021 Nov 08, 2021

Copy link to clipboard

Copied

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)

Votes

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
community guidelines
Community Expert ,
Nov 08, 2021 Nov 08, 2021

Copy link to clipboard

Copied

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

image.png

 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

Votes

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
community guidelines
Guide ,
Nov 08, 2021 Nov 08, 2021

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.

Votes

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
community guidelines
Enthusiast ,
Nov 08, 2021 Nov 08, 2021

Copy link to clipboard

Copied

LATEST

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

Photo-editing (Ps/Lr/LrC) and photography workshops & one-on-one training (off- and online)

Votes

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
community guidelines