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

Get List of all Photoshop Documents

Enthusiast ,
Nov 10, 2017 Nov 10, 2017

Copy link to clipboard

Copied

Hi everybody

I was wondering - does anyone know of a way to get a list of all documents that are currently loaded into Photoshop? The list would include the entire title of each document, (including the @33.3%, (RGB/8)* that might come after each title, for example.)

Basically, it would be a simple list, with each title on its own new line.

I could have sworn that I had some code like this before, but can't find it.

Is this a simple task?

Thanks in advance

TOPICS
Actions and scripting

Views

2.6K

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

correct answers 1 Correct answer

Guide , Nov 12, 2017 Nov 12, 2017

Does this help...

var docs = app.documents;

var docList = new Array(docs.length);

var aDoc = null;

var l = null;

var m = null;

for (var i = 0; i < docs.length; i += 1) {

    aDoc = docs;

    var ref = new ActionReference();

    ref.putIndex(charIDToTypeID("Dcmn"), i + 1);

    var desc = executeActionGet(ref);

    var z = " @" + (Math.round(Number(desc.getDouble(stringIDToTypeID("zoom")) * 1000)) / 10) + "% (" + l = aDoc.layers.length > 1 ? aDoc.activeLayer.name + ", " : "";

    m = aDoc.bitsPerChannel.toSt

...

Votes

Translate

Translate
Adobe
Guide ,
Nov 11, 2017 Nov 11, 2017

Copy link to clipboard

Copied

It is a bit of a mixture as that line does some profile checking, here is one way of getting all the information, but you would have to sort out the profile mismatches etc.

Script to be run from ExtendScript Toolkit.

#target photoshop;

$.writeln("Working spaces");

$.writeln("....................");

$.writeln(getWorkingColourSettings().join("\n"));

$.writeln("....................");

$.writeln(getDocInfo().join("\n"));

function getDocInfo(){

var IDs = new Array();

var count = app.documents.length;

for(var a =1; a<count+1;a++){

var ref = new ActionReference();

ref.putIndex( charIDToTypeID( 'Dcmn' ), a);

var desc = executeActionGet(ref);

var Zoom = Number(desc.getDouble(stringIDToTypeID('zoom'))*100).toFixed(0);

var Mode = typeIDToStringID(desc.getEnumerationValue( stringIDToTypeID( 'mode' )));

var Depth = desc.getDouble(stringIDToTypeID('depth'));

if(desc.hasKey (stringIDToTypeID( 'profile' ))){

var Profile = desc.getString(stringIDToTypeID( 'profile' ));

}else{

    var Profile = "#";

    }

var ID = desc.getInteger (stringIDToTypeID('documentID'));

var Title = desc.getString(stringIDToTypeID('title'));

IDs.push([[ID],[Title],[Zoom],[Mode],[Depth],[Profile]]);

    }

return IDs;

};

function getWorkingColourSettings(){

var ws = new Array();

var desc = new ActionDescriptor();

var ref = new ActionReference();

ref.putProperty( charIDToTypeID('Prpr'), stringIDToTypeID('colorSettings') );

ref.putEnumerated( charIDToTypeID('capp'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );

var desc = executeActionGet(ref).getObjectValue(stringIDToTypeID('colorSettings'));

ws.push(desc.getString( stringIDToTypeID('workingRGB')));

ws.push(desc.getString( stringIDToTypeID('workingCMYK')));

ws.push(desc.getString( stringIDToTypeID('workingGray')));

return ws;

};

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 11, 2017 Nov 11, 2017

Copy link to clipboard

Copied

Not bad.

But IMO boo radley 2013​ means something like this:

documents_listOfOpenedDocuments.png

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 11, 2017 Nov 11, 2017

Copy link to clipboard

Copied

pixxxel schubser: yes, that's it !

Do you happen to have a script for that?

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 11, 2017 Nov 11, 2017

Copy link to clipboard

Copied

I think.

At the end of last year I played with a similar requirement. It was only a study … …somewhere on my computer.

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 12, 2017 Nov 12, 2017

Copy link to clipboard

Copied

Didn't found the jsx yet. I only found the jsxbin. But should also works

#target photoshop

// documents_listOfOpenedDocumentsModeBitdepth_jsxbin.jsx

eval("""@JSXBIN@ES@2.0@MyBbyBn0AGJAnASzEjEjPjDjTByBXzJjEjPjDjVjNjFjOjUjTCfjzDjBjQjQDfnft\

JBnASzHjEjPjDiMjJjTjUEyBEjzFiBjSjSjBjZFfRBXzGjMjFjOjHjUjIGfVBfyBftnftJCnASzEjBi\

EjPjDHyBnbftJDnASzBjMIyBnbftJEnASzBjNJyBnbftaGbHn0AHJHnASHyBQzAKfVBfyBjzBjJLfnf\

fJInASzDjSjFjGMyBEjzPiBjDjUjJjPjOiSjFjGjFjSjFjOjDjFNfntnftJJnAEXzIjQjVjUiJjOjEj\

FjYOfVMfyBRCEjzOjDjIjBjSiJiEiUjPiUjZjQjFiJiEPfRBFeEiEjDjNjOffCzBhLQjLfnndBffJKn\

ASzEjEjFjTjDRyBEjzQjFjYjFjDjVjUjFiBjDjUjJjPjOiHjFjUSfRBVMfyBffnftJLnASzBjaTyBCQ\

CQCQnCzBhPUEXzFjSjPjVjOjEVfjzEiNjBjUjIWfRBEjzGiOjVjNjCjFjSXfRBCzBhKYEXzJjHjFjUi\

EjPjVjCjMjFZfVRfyBRBEjzQjTjUjSjJjOjHiJiEiUjPiUjZjQjFiJiEgafRBFeEjajPjPjNffffnnd\

2nIDffffnndKeChAiAnnneDhFhAhISIyBdCzBhegbXGfXzGjMjBjZjFjSjTgcfVHfyBnndBCQXzEjOj\

BjNjFgdfXzLjBjDjUjJjWjFiMjBjZjFjSgefVHfyBnneChMhAFeAnffnnnftJMnASJyBEXzHjSjFjQj\

MjBjDjFgffEXzIjUjPiTjUjSjJjOjHhAfXzOjCjJjUjTiQjFjSiDjIjBjOjOjFjMhBfVHfyBnfRCFeT\

iCjJjUjTiQjFjSiDjIjBjOjOjFjMiUjZjQjFhOFeAffnffJNnABQKfVEfyBjLfCQCQCQXgdfVHfyBVT\

fyBnnEXgffEXgffEXhAfXzEjNjPjEjFhCfVHfyBnfRCFeNiEjPjDjVjNjFjOjUiNjPjEjFhOFeAffRC\

FeGiCiJiUiNiBiQFeGiCjJjUjNjBjQffnnSJyBdCzChdhdhDVJfyBnneDiPiOiFFeBhJdChDVJfyBnn\

eFiFiJiHiIiUFeEhPhYhDhJdChDVJfyBnneHiTiJiYiUiFiFiOFeFhPhRhWhDhJFeFhPhThShDhJnff\

nnnfAjLfAXGfVBfyBByBzBhchEAIJ4E0AiAB40BiAM4F0AiAR4G0AiAE4B0AiAI4D0AiAH4C0AiAT4H\

0AiAAIAKByB""");

alert(docList.join("\n"));

Give it a try and have fun

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
Valorous Hero ,
Nov 12, 2017 Nov 12, 2017

Copy link to clipboard

Copied

https://forums.adobe.com/people/pixxxel+schubser  написал(а)

Didn't found the jsx yet. I only found the jsxbin. But should also works

......

Give it a try and have fun

This script is lying.

Untitled-3.png

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 12, 2017 Nov 12, 2017

Copy link to clipboard

Copied

No. This snippet only ignores the color profile and the color proof view. And I can't change this because of this snippet is only an older jsxbin. I didn't found the jsx.

Have fun

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 12, 2017 Nov 12, 2017

Copy link to clipboard

Copied

Does this help...

var docs = app.documents;

var docList = new Array(docs.length);

var aDoc = null;

var l = null;

var m = null;

for (var i = 0; i < docs.length; i += 1) {

    aDoc = docs;

    var ref = new ActionReference();

    ref.putIndex(charIDToTypeID("Dcmn"), i + 1);

    var desc = executeActionGet(ref);

    var z = " @" + (Math.round(Number(desc.getDouble(stringIDToTypeID("zoom")) * 1000)) / 10) + "% (" + l = aDoc.layers.length > 1 ? aDoc.activeLayer.name + ", " : "";

    m = aDoc.bitsPerChannel.toString().replace("BitsPerChannelType.", "");

    docList = aDoc.name + z + aDoc.mode.toString().replace("DocumentMode.", "").replace("BITMAP", "Bitmap") + m = m == "ONE" ? ")" : (m == "EIGHT" ? "/8#)" : (m == "SIXTEEN" ? "/16#)" : "/32#)"));

}

alert(docList.join("\n"));

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 12, 2017 Nov 12, 2017

Copy link to clipboard

Copied

SuperMerlin  schrieb

Does this help...

var docs = app.documents; var docList = new Array(docs.length); var aDoc = null; var l = null; var m = null; for (var i = 0; i < docs.length; i += 1) {     aDoc = docs;     var ref = new ActionReference();     ref.putIndex(charIDToTypeID("Dcmn"), i + 1);     var desc = executeActionGet(ref);     var z = " @" + (Math.round(Number(desc.getDouble(stringIDToTypeID("zoom")) * 1000)) / 10) + "% (" + l = aDoc.layers.length > 1 ? aDoc.activeLayer.name + ", " : "";     m = aDoc.bitsPerChannel.toString().replace("BitsPerChannelType.", "");     docList = aDoc.name + z + aDoc.mode.toString().replace("DocumentMode.", "").replace("BITMAP", "Bitmap") + m = m == "ONE" ? ")" : (m == "EIGHT" ? "/8#)" : (m == "SIXTEEN" ? "/16#)" : "/32#)")); } alert(docList.join("\n"));  

SuperMerlin, you seems to be a very very bad boy.

This is my kind of coding and my variables also. This is my binary decoded - right?

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 12, 2017 Nov 12, 2017

Copy link to clipboard

Copied

this works!

Thanks, SuperMerlin!!

And thanks to pixxel schubser and r-bin as well

this will be a very useful script to switch documents in Photoshop.

Right now I hate clicking on the tabs to change documents. There should be a "list", or a document panel or something which would make it much faster to find the document you want to switch to.

This script will be the first step in designing a listview of all documents. Kind of like clicking on the "Window" menu in Photoshop, then scrolling down to the document you want - but that's a hassle too. There needs to be a panel or something with a list of all documents that is visible at all times, sort of like the layers panel.

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 12, 2017 Nov 12, 2017

Copy link to clipboard

Copied

it says "Syntax Error" on Line 3

Didn't found the jsx yet. I only found the jsxbin. But should also works

  1. #target photoshop 
  2. // documents_listOfOpenedDocumentsModeBitdepth_jsxbin.jsx 
  3. eval("""@JSXBIN@ES@2.0@MyBbyBn0AGJAnASzEjEjPjDjTByBXzJjEjPjDjVjNjFjOjUjTCfjzDjBjQjQDfnft\ 
  4. JBnASzHjEjPjDiMjJjTjUEyBEjzFiBjSjSjBjZFfRBXzGjMjFjOjHjUjIGfVBfyBftnftJCnASzEjBi\ 
  5. EjPjDHyBnbftJDnASzBjMIyBnbftJEnASzBjNJyBnbftaGbHn0AHJHnASHyBQzAKfVBfyBjzBjJLfnf\ 
  6. fJInASzDjSjFjGMyBEjzPiBjDjUjJjPjOiSjFjGjFjSjFjOjDjFNfntnftJJnAEXzIjQjVjUiJjOjEj\ 
  7. FjYOfVMfyBRCEjzOjDjIjBjSiJiEiUjPiUjZjQjFiJiEPfRBFeEiEjDjNjOffCzBhLQjLfnndBffJKn\ 
  8. ASzEjEjFjTjDRyBEjzQjFjYjFjDjVjUjFiBjDjUjJjPjOiHjFjUSfRBVMfyBffnftJLnASzBjaTyBCQ\ 
  9. CQCQnCzBhPUEXzFjSjPjVjOjEVfjzEiNjBjUjIWfRBEjzGiOjVjNjCjFjSXfRBCzBhKYEXzJjHjFjUi\ 
  10. EjPjVjCjMjFZfVRfyBRBEjzQjTjUjSjJjOjHiJiEiUjPiUjZjQjFiJiEgafRBFeEjajPjPjNffffnnd\ 
  11. 2nIDffffnndKeChAiAnnneDhFhAhISIyBdCzBhegbXGfXzGjMjBjZjFjSjTgcfVHfyBnndBCQXzEjOj\ 
  12. BjNjFgdfXzLjBjDjUjJjWjFiMjBjZjFjSgefVHfyBnneChMhAFeAnffnnnftJMnASJyBEXzHjSjFjQj\ 
  13. MjBjDjFgffEXzIjUjPiTjUjSjJjOjHhAfXzOjCjJjUjTiQjFjSiDjIjBjOjOjFjMhBfVHfyBnfRCFeT\ 
  14. iCjJjUjTiQjFjSiDjIjBjOjOjFjMiUjZjQjFhOFeAffnffJNnABQKfVEfyBjLfCQCQCQXgdfVHfyBVT\ 
  15. fyBnnEXgffEXgffEXhAfXzEjNjPjEjFhCfVHfyBnfRCFeNiEjPjDjVjNjFjOjUiNjPjEjFhOFeAffRC\ 
  16. FeGiCiJiUiNiBiQFeGiCjJjUjNjBjQffnnSJyBdCzChdhdhDVJfyBnneDiPiOiFFeBhJdChDVJfyBnn\ 
  17. eFiFiJiHiIiUFeEhPhYhDhJdChDVJfyBnneHiTiJiYiUiFiFiOFeFhPhRhWhDhJFeFhPhThShDhJnff\ 
  18. nnnfAjLfAXGfVBfyBByBzBhchEAIJ4E0AiAB40BiAM4F0AiAR4G0AiAE4B0AiAI4D0AiAH4C0AiAT4H\ 
  19. 0AiAAIAKByB"""); 
  20. alert(docList.join("\n")); 

Give it a try and have fun

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 12, 2017 Nov 12, 2017

Copy link to clipboard

Copied

Be sure that your did not copy any additional spaces before or between or after the visible code.

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 12, 2017 Nov 12, 2017

Copy link to clipboard

Copied

Getting closer but no profile checking.

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
Valorous Hero ,
Nov 11, 2017 Nov 11, 2017

Copy link to clipboard

Copied

Try this script (jsxbin). Works only on windows.

getdocs.jsxbin - Google Drive

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 11, 2017 Nov 11, 2017

Copy link to clipboard

Copied

r-bin: thanks - the script undocks all documents first ("float all in windows"), then presumably gets all document titles, then re-docks them all again - but the alert that pops up is empty.

SuperMerlin - thanks as well, I tried downloading ExtendedToolScript but the Cloud application window just keeps "waiting..." for hours - seems I can't download that app for whatever reason.

It's all good - it isn't that important a deal, I just seemed to remember having some code that did this a while back, but maybe it's more difficult than it appears

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
Valorous Hero ,
Nov 13, 2017 Nov 13, 2017

Copy link to clipboard

Copied

LATEST

radley+2013  написал(а)

r-bin: thanks - the script undocks all documents first ("float all in windows"), then presumably gets all document titles, then re-docks them all again - but the alert that pops up is empty.

I checked my jsxbin script on CS6 win7 x64. Works great)

xxxx.png

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 12, 2017 Nov 12, 2017

Copy link to clipboard

Copied

That script writes an exe file to get the windows titles, but it is 32bit so does not work on 64bit systems.

TASKLIST /v /FI "imagename eq photoshop.exe"

Will give you the information for the active document.

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
Valorous Hero ,
Nov 12, 2017 Nov 12, 2017

Copy link to clipboard

Copied

SuperMerlin  написал(а)

That script writes an exe file to get the windows titles, but it is 32bit so does not work on 64bit systems.

TASKLIST /v /FI "imagename eq photoshop.exe"

Will give you the information for the active document.

Yes, you got me through. )
I use the utility "cmdow.exe" to get a list of all the windows. I filter the list on the line "Phototoshop" and determine that this is a document by the " @ " in the header. It's strange that it does not work on x64. Tomorrow can be checked. Also, an error was detected when using CC2018. The script can not correctly determine whether the photoshop is in tabs or float mode. Something changed in preferences.

P.S. For some reason, I will not yet lay out the source code of the script.

P.S.S. English through translator

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
Valorous Hero ,
Nov 12, 2017 Nov 12, 2017

Copy link to clipboard

Copied

You can try to create an analogue of the title of the document window using the following template.

var Title = Copyrighted?"© ":"" + DocName + " @ " + Zoom + "% " +

"(" +

ActiveLayer?(ActiveLayerName + ", "):"" +

ActiveChannelName + "/" + Depth +

UntaggedSpaceIndicator?"#":"" +

NonWorkingSpaceIndicator?"*":"" +

ProofIndicator?("/"+Proof):"") +

PixelHSFIndicator?" [scaled]":"" +

")" +

DirtyDocIndicator?" *":"" +

PendingSaveIndicator?(" - Saving " + pcnt + "%"):""

It remains only to get the required parameters

upd.

was updated

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