Link in Zwischenablage kopieren
Kopiert
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
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
Link in Zwischenablage kopieren
Kopiert
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;
};
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
pixxxel schubser: yes, that's it !
Do you happen to have a script for that?
Link in Zwischenablage kopieren
Kopiert
I think.
At the end of last year I played with a similar requirement. It was only a study … …somewhere on my computer.
Link in Zwischenablage kopieren
Kopiert
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
Link in Zwischenablage kopieren
Kopiert
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.
Link in Zwischenablage kopieren
Kopiert
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
Link in Zwischenablage kopieren
Kopiert
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"));
Link in Zwischenablage kopieren
Kopiert
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?
Link in Zwischenablage kopieren
Kopiert
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.
Link in Zwischenablage kopieren
Kopiert
it says "Syntax Error" on Line 3
Didn't found the jsx yet. I only found the jsxbin. But should also works
Give it a try and have fun
Link in Zwischenablage kopieren
Kopiert
Be sure that your did not copy any additional spaces before or between or after the visible code.
Link in Zwischenablage kopieren
Kopiert
Getting closer but no profile checking.
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
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
Link in Zwischenablage kopieren
Kopiert
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)
Link in Zwischenablage kopieren
Kopiert
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.
Link in Zwischenablage kopieren
Kopiert
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
Link in Zwischenablage kopieren
Kopiert
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
Weitere Inspirationen, Events und Ressourcen finden Sie in der neuen Adobe Community
Jetzt ansehen