Viewless document - examples?

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

User avatar
Jaroslav Bereza
Posts: 38
Joined: Tue Dec 27, 2016 7:22 pm

Viewless document - examples?

Post by Jaroslav Bereza »

I am looking for more examples how to work with viewless document.

Viewless document is document which is like open document, but can't be seen in Photoshop and can't be seen in DOM. But you should be able work with it via action manager code. Because it is invisible, it has great performance. And it doesn't show annoying window if you want open Smart Object and then close it.

I was able gain core code from "load files into stack" and it works good for flatten images. And now I am looking for way how to:
1) create invisible document
2) push layers inside this document
3) select all layers
4) copy all layers into another document

This is my code:

Code: Select all

const kaddLayerFromViewlessDocStr	= app.stringIDToTypeID("addLayerFromViewlessDoc");
const kaspectRatioStr = app.stringIDToTypeID("aspectRatio");
const keyHeight = app.charIDToTypeID('Hght');
const keyViewlessDoc = app.stringIDToTypeID( "viewlessDoc" );
const keyWidth = app.charIDToTypeID('Wdth');
const klayersStr = app.stringIDToTypeID("layers");
const kflatnessStr = app.stringIDToTypeID("flatness");
const kdocumentStr = app.stringIDToTypeID("document");
const keyFileList = app.stringIDToTypeID( "fileList" );
const kpreferXMPFromACRStr = app.stringIDToTypeID("preferXMPFromACR");
const kcloseViewlessDocumentStr = app.stringIDToTypeID("closeViewlessDocument");
const kopenViewlessDocumentStr = app.stringIDToTypeID("openViewlessDocument");

function ViewlessDocument( desc, pathname )
{

this.height = new UnitValue( desc.getInteger( keyHeight ), "px" );
this.width = new UnitValue( desc.getInteger( keyWidth ), "px" );
this.pixelAspectRatio = desc.getDouble( kaspectRatioStr );
this.layerCount = desc.getInteger( klayersStr );
this.isSimple = desc.getBoolean( kflatnessStr );

this.viewlessDocPtr = desc.getData( kdocumentStr );
this.path = pathname;
this.isOpen = true;
}

ViewlessDocument.prototype.addToActiveDocument = function()
{
var i, fileListDesc = new ActionList();
var ptrListDesc = new ActionList();

fileListDesc.putPath( new File( this.path ) );
ptrListDesc.putData( this.viewlessDocPtr );

var desc = new ActionDescriptor();
desc.putList( keyFileList, fileListDesc );
desc.putList( keyViewlessDoc, ptrListDesc );
executeAction( kaddLayerFromViewlessDocStr, desc, DialogModes.NO );
this.isOpen = false; // Adding the layer closes the document
}

ViewlessDocument.prototype.close = function( options )
{
if (this.isOpen)
{
var desc = new ActionDescriptor();
desc.putData( kdocumentStr, this.viewlessDocPtr );
executeAction( kcloseViewlessDocumentStr, desc );
this.isOpen = false;
}
}

function openViewlessDocument( pathname )
{
var desc = new ActionDescriptor();
desc.putBoolean( kpreferXMPFromACRStr, false );
desc.putPath( app.charIDToTypeID('File'), new File( pathname ) );
var result = executeAction( kopenViewlessDocumentStr, desc, DialogModes.NO );
var psViewPtr = result.getData( kdocumentStr );
if (psViewPtr.length == 0)
{
return null;
}
return new ViewlessDocument( result, pathname );
}

var fPSDoc = openViewlessDocument ("c://your//path//to//file.png");
fPSDoc.addToActiveDocument();
fPSDoc.close();
JavierAroche
Posts: 29
Joined: Sat Jul 30, 2016 3:52 am
Location: San Francisco

Re: Viewless document - examples?

Post by JavierAroche »

Hey Jaroslav,

This is the first time I hear about viewless documents. I'll have to do some research :)

I found this old forum post by xbytor and davide in an archived version of this forum, or something like that.
http://psscripts.tbitdesign.com/archive ... ic8365.php

It sounds like viewless documents might be very limited. I would love to explore some more on this subject, but I don't even know where to start... I guess I'll look into the "load files into stack" and the "ContactSheet" scripts.
User avatar
Jaroslav Bereza
Posts: 38
Joined: Tue Dec 27, 2016 7:22 pm

Re: Viewless document - examples?

Post by Jaroslav Bereza »

If I open document, I get descriptor as return value, but it seems, that descriptor contains only limited informations about document.

Or maybe your script can't see everything?
Most weird thing is that document ID is Raw-type.

Code: Select all

Result: [object Object]
{
"height": {
"stringID": "height",
"charID": "Hght",
"id": 1214736500,
"key": 0,
"type": "DescValueType.INTEGERTYPE",
"value": 2102
},
"width": {
"stringID": "width",
"charID": "Wdth",
"id": 1466201192,
"key": 1,
"type": "DescValueType.INTEGERTYPE",
"value": 1887
},
"depth": {
"stringID": "depth",
"charID": "Dpth",
"id": 1148220520,
"key": 2,
"type": "DescValueType.INTEGERTYPE",
"value": 8
},
"mode": {
"stringID": "mode",
"charID": "Md ",
"id": 1298407456,
"key": 3,
"type": "DescValueType.CLASSTYPE",
"value": 1380401741
},
"aspectRatio": {
"stringID": "aspectRatio",
"charID": "",
"id": 619,
"key": 4,
"type": "DescValueType.DOUBLETYPE",
"value": 1
},
"layers": {
"stringID": "layers",
"charID": "Lyrs",
"id": 1283027571,
"key": 5,
"type": "DescValueType.INTEGERTYPE",
"value": 1
},
"flatness": {
"stringID": "flatness",
"charID": "Fltn",
"id": 1181512814,
"key": 6,
"type": "DescValueType.BOOLEANTYPE",
"value": false
},
"pixel": {
"stringID": "pixel",
"charID": "Pxel",
"id": 1350067564,
"key": 7,
"type": "DescValueType.BOOLEANTYPE",
"value": true
},
"XMPMetadataAsUTF8": {
"stringID": "XMPMetadataAsUTF8",
"charID": "",
"id": 3703,
"key": 8,
"type": "DescValueType.STRINGTYPE",
"value": "<?xpacket begin=\"\ufeff\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?>\n<x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"Adobe XMP Core 5.6-c138 79.159824, 2016/09/14-01:09:01 \">\n <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <rdf:Description rdf:about=\"\"\n xmlns:xmp=\"http://ns.adobe.com/xap/1.0/\"\n xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n xmlns:photoshop=\"http://ns.adobe.com/photoshop/1.0/\">\n <xmp:CreatorTool>Adobe Photoshop CC 2017 (Windows)</xmp:CreatorTool>\n <xmp:CreateDate>2016-11-20T01:20:12+01:00</xmp:CreateDate>\n <xmp:ModifyDate>2016-11-20T01:20:12+01:00</xmp:ModifyDate>\n <xmp:MetadataDate>2016-11-20T01:20:12+01:00</xmp:MetadataDate>\n <dc:format>image/png</dc:format>\n <photoshop:ColorMode>3</photoshop:ColorMode>\n </rdf:Description>\n </rdf:RDF>\n</x:xmpmeta>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n<?xpacket end=\"w\"?>"
},
"document": {
"stringID": "document",
"charID": "Dcmn",
"id": 1147366766,
"key": 9,
"type": "DescValueType.RAWTYPE",
"value": "\u0010U\u008có×\u0001\u0000\u0000"
}
}
User avatar
Kukurykus
Posts: 528
Joined: Mon Jul 25, 2016 12:36 pm

Re: Viewless document - examples?

Post by Kukurykus »

Look at this topic on our forum taken from that Archive. It ends in a half :( I noticed that many other topic restored from that archive got only main topic but no replys. Originally I thought that they were posted but when Tom, Admin of this forums wanted to 'transfer' them they weren't already available on the date where you could read them. So he took last date with that topic, so before next posts were posted in good time to be automatically archived by that Archive service. From the other site I see you linked us to old forums of Mike Hall, but already put to our new administrator website ?! It kept old apparance and entire content, than that is when you search it on new forums. Why is that? Isn't it still possible to retrieve this topic in full and all other topics I see they were answered but unfortunatelly we got only a question post"? (I'm sorry for off-topic)

viewtopic.php?f=77&t=22655
JavierAroche
Posts: 29
Joined: Sat Jul 30, 2016 3:52 am
Location: San Francisco

Re: Viewless document - examples?

Post by JavierAroche »

Hey Jaroslav, is that document descriptor from opening a viewless document? That object is different from a regular photoshop document.

The descriptor-info module should return a similar object like the one below from a regular photoshop document.

Code: Select all

{
"mode": {
"stringID": "mode",
"charID": "Md ",
"id": 1298407456,
"key": 0,
"type": "DescValueType.ENUMERATEDTYPE",
"value": "RGBColor",
"enumerationType": "colorSpace"
},
"bigNudgeH": {
"stringID": "bigNudgeH",
"charID": "BgNH",
"id": 1114066504,
"key": 1,
"type": "DescValueType.INTEGERTYPE",
"value": 655360
},
"bigNudgeV": {
"stringID": "bigNudgeV",
"charID": "BgNV",
"id": 1114066518,
"key": 2,
"type": "DescValueType.INTEGERTYPE",
"value": 655360
},
"rulerOriginH": {
"stringID": "rulerOriginH",
"charID": "RlrH",
"id": 1382838856,
"key": 3,
"type": "DescValueType.INTEGERTYPE",
"value": 0
},
"rulerOriginV": {
"stringID": "rulerOriginV",
"charID": "RlrV",
"id": 1382838870,
"key": 4,
"type": "DescValueType.INTEGERTYPE",
"value": 0
},
"width": {
"stringID": "width",
"charID": "Wdth",
"id": 1466201192,
"key": 5,
"type": "DescValueType.UNITDOUBLE",
"value": 1594
},
"height": {
"stringID": "height",
"charID": "Hght",
"id": 1214736500,
"key": 6,
"type": "DescValueType.UNITDOUBLE",
"value": 2500
},
"resolution": {
"stringID": "resolution",
"charID": "Rslt",
"id": 1383296116,
"key": 7,
"type": "DescValueType.UNITDOUBLE",
"value": 72
},
"title": {
"stringID": "title",
"charID": "Ttl ",
"id": 1416916000,
"key": 8,
"type": "DescValueType.STRINGTYPE",
"value": "Untitled-1"
},
"fileInfo": {
"stringID": "fileInfo",
"charID": "FlIn",
"id": 1181501806,
"key": 9,
"type": "DescValueType.OBJECTTYPE",
"value": {
"count": 0,
"typename": "ActionDescriptor"
},
"object": {

}
},
"numberOfPaths": {
"stringID": "numberOfPaths",
"charID": "NmbP",
"id": 1315791440,
"key": 10,
"type": "DescValueType.INTEGERTYPE",
"value": 0
},
"numberOfChannels": {
"stringID": "numberOfChannels",
"charID": "NmbO",
"id": 1315791439,
"key": 11,
"type": "DescValueType.INTEGERTYPE",
"value": 3
},
"numberOfLayers": {
"stringID": "numberOfLayers",
"charID": "NmbL",
"id": 1315791436,
"key": 12,
"type": "DescValueType.INTEGERTYPE",
"value": 40
},
"targetPathIndex": {
"stringID": "targetPathIndex",
"charID": "TrgP",
"id": 1416783696,
"key": 13,
"type": "DescValueType.INTEGERTYPE",
"value": -1
},
"workPathIndex": {
"stringID": "workPathIndex",
"charID": "WrkP",
"id": 1467116368,
"key": 14,
"type": "DescValueType.INTEGERTYPE",
"value": -1
},
"clippingPathInfo": {
"stringID": "clippingPathInfo",
"charID": "Clpg",
"id": 1131180135,
"key": 15,
"type": "DescValueType.OBJECTTYPE",
"value": {
"count": 2,
"typename": "ActionDescriptor"
},
"object": {
"clippingPathIndex": {
"stringID": "clippingPathIndex",
"charID": "ClpI",
"id": 1131180105,
"key": 0,
"type": "DescValueType.INTEGERTYPE",
"value": -1
},
"clippingPathFlatness": {
"stringID": "clippingPathFlatness",
"charID": "ClpF",
"id": 1131180102,
"key": 1,
"type": "DescValueType.INTEGERTYPE",
"value": 0
}
}
},
"depth": {
"stringID": "depth",
"charID": "Dpth",
"id": 1148220520,
"key": 16,
"type": "DescValueType.INTEGERTYPE",
"value": 8
},
"documentID": {
"stringID": "documentID",
"charID": "DocI",
"id": 1148150601,
"key": 17,
"type": "DescValueType.INTEGERTYPE",
"value": 1484
},
"copyright": {
"stringID": "copyright",
"charID": "Cpyr",
"id": 1131444594,
"key": 18,
"type": "DescValueType.BOOLEANTYPE",
"value": false
},
"watermark": {
"stringID": "watermark",
"charID": "watr",
"id": 2002875506,
"key": 19,
"type": "DescValueType.BOOLEANTYPE",
"value": false
},
"isDirty": {
"stringID": "isDirty",
"charID": "IsDr",
"id": 1232290930,
"key": 20,
"type": "DescValueType.BOOLEANTYPE",
"value": true
},
"count": {
"stringID": "count",
"charID": "Cnt ",
"id": 1131312160,
"key": 21,
"type": "DescValueType.INTEGERTYPE",
"value": 1
},
"itemIndex": {
"stringID": "itemIndex",
"charID": "ItmI",
"id": 1232366921,
"key": 22,
"type": "DescValueType.INTEGERTYPE",
"value": 1
},
"manage": {
"stringID": "manage",
"charID": "",
"id": 375,
"key": 23,
"type": "DescValueType.ENUMERATEDTYPE",
"value": "workingSpaceCode",
"enumerationType": "manage"
},
"profile": {
"stringID": "profile",
"charID": "",
"id": 376,
"key": 24,
"type": "DescValueType.STRINGTYPE",
"value": "sRGB IEC61966-2.1"
},
"workflow": {
"stringID": "workflow",
"charID": "",
"id": 3018,
"key": 25,
"type": "DescValueType.OBJECTTYPE",
"value": {
"count": 1,
"typename": "ActionDescriptor"
},
"object": {
"workflowIsManaged": {
"stringID": "workflowIsManaged",
"charID": "",
"id": 3054,
"key": 0,
"type": "DescValueType.BOOLEANTYPE",
"value": false
}
}
},
"quickMask": {
"stringID": "quickMask",
"charID": "QucM",
"id": 1366647629,
"key": 26,
"type": "DescValueType.BOOLEANTYPE",
"value": false
},
"histogram": {
"stringID": "histogram",
"charID": "Hstg",
"id": 1215525991,
"key": 27,
"type": "DescValueType.LISTTYPE",
"value": {
"count": 256,
"typename": "ActionList"
},
"list": []
},
"pixelScaleFactor": {
"stringID": "pixelScaleFactor",
"charID": "",
"id": 1191,
"key": 28,
"type": "DescValueType.UNITDOUBLE",
"value": 1
},
"XMPMetadataAsUTF8": {
"stringID": "XMPMetadataAsUTF8",
"charID": "",
"id": 3019,
"key": 29,
"type": "DescValueType.STRINGTYPE",
"value": ""
},
"measurementScale": {
"stringID": "measurementScale",
"charID": "",
"id": 1195,
"key": 30,
"type": "DescValueType.OBJECTTYPE",
"value": {
"count": 2,
"typename": "ActionDescriptor"
},
"object": {
"null": {
"stringID": "null",
"charID": "null",
"id": 1853189228,
"key": 0,
"type": "DescValueType.REFERENCETYPE",
"value": {
"typename": "ActionReference"
},
"reference": {
"count": 1,
"typename": "ActionDescriptor"
}
},
"to": {
"stringID": "to",
"charID": "T ",
"id": 1411391520,
"key": 1,
"type": "DescValueType.OBJECTTYPE",
"value": {
"count": 3,
"typename": "ActionDescriptor"
},
"object": {
"pixelLength": {
"stringID": "pixelLength",
"charID": "",
"id": 1563,
"key": 0,
"type": "DescValueType.INTEGERTYPE",
"value": 1
},
"logicalLength": {
"stringID": "logicalLength",
"charID": "",
"id": 1564,
"key": 1,
"type": "DescValueType.DOUBLETYPE",
"value": 1
},
"logicalUnits": {
"stringID": "logicalUnits",
"charID": "",
"id": 1565,
"key": 2,
"type": "DescValueType.STRINGTYPE",
"value": "pixels"
}
}
}
}
},
"targetLayers": {
"stringID": "targetLayers",
"charID": "",
"id": 3022,
"key": 31,
"type": "DescValueType.LISTTYPE",
"value": {
"count": 1,
"typename": "ActionList"
},
"list": [
{
"count": 37,
"typename": "ActionDescriptor"
}
]
},
"targetLayersIDs": {
"stringID": "targetLayersIDs",
"charID": "",
"id": 3024,
"key": 32,
"type": "DescValueType.LISTTYPE",
"value": {
"count": 1,
"typename": "ActionList"
},
"list": [
{
"count": 37,
"typename": "ActionDescriptor"
}
]
},
"targetLayersIndexes": {
"stringID": "targetLayersIndexes",
"charID": "",
"id": 3023,
"key": 33,
"type": "DescValueType.LISTTYPE",
"value": {
"count": 1,
"typename": "ActionList"
},
"list": [
{
"count": 37,
"typename": "ActionDescriptor"
}
]
},
"zoom": {
"stringID": "zoom",
"charID": "Zm ",
"id": 1517101088,
"key": 34,
"type": "DescValueType.UNITDOUBLE",
"value": 0.0625
},
"printCopies": {
"stringID": "printCopies",
"charID": "",
"id": 3026,
"key": 35,
"type": "DescValueType.INTEGERTYPE",
"value": 1
},
"printCurrentPrinter": {
"stringID": "printCurrentPrinter",
"charID": "",
"id": 718,
"key": 36,
"type": "DescValueType.STRINGTYPE",
"value": "Lexmark X954"
},
"printerList": {
"stringID": "printerList",
"charID": "",
"id": 3027,
"key": 37,
"type": "DescValueType.LISTTYPE",
"value": {
"count": 2,
"typename": "ActionList"
},
"list": [
"Deskjet 3520 series",
"Lexmark X954"
]
},
"printColorHandling": {
"stringID": "printColorHandling",
"charID": "",
"id": 3028,
"key": 38,
"type": "DescValueType.ENUMERATEDTYPE",
"value": "printerManaged",
"enumerationType": "printColorHandling"
},
"printOutputOptions": {
"stringID": "printOutputOptions",
"charID": "",
"id": 1180,
"key": 39,
"type": "DescValueType.OBJECTTYPE",
"value": {
"count": 23,
"typename": "ActionDescriptor"
},
"object": {
"caption": {
"stringID": "caption",
"charID": "Cptn",
"id": 1131443310,
"key": 0,
"type": "DescValueType.BOOLEANTYPE",
"value": false
},
"calibrationBars": {
"stringID": "calibrationBars",
"charID": "Clbr",
"id": 1131176562,
"key": 1,
"type": "DescValueType.BOOLEANTYPE",
"value": false
},
"registrationMarks": {
"stringID": "registrationMarks",
"charID": "RgsM",
"id": 1382511437,
"key": 2,
"type": "DescValueType.BOOLEANTYPE",
"value": false
},
"cornerCropMarks": {
"stringID": "cornerCropMarks",
"charID": "CrnC",
"id": 1131572803,
"key": 3,
"type": "DescValueType.BOOLEANTYPE",
"value": false
},
"centerCropMarks": {
"stringID": "centerCropMarks",
"charID": "CntC",
"id": 1131312195,
"key": 4,
"type": "DescValueType.BOOLEANTYPE",
"value": false
},
"labels": {
"stringID": "labels",
"charID": "Lbls",
"id": 1281518707,
"key": 5,
"type": "DescValueType.BOOLEANTYPE",
"value": false
},
"negative": {
"stringID": "negative",
"charID": "Ngtv",
"id": 1315402870,
"key": 6,
"type": "DescValueType.BOOLEANTYPE",
"value": false
},
"emulsionDown": {
"stringID": "emulsionDown",
"charID": "EmlD",
"id": 1164799044,
"key": 7,
"type": "DescValueType.BOOLEANTYPE",
"value": false
},
"interfaceIconFrameDimmed": {
"stringID": "interfaceIconFrameDimmed",
"charID": "Intr",
"id": 1231975538,
"key": 8,
"type": "DescValueType.BOOLEANTYPE",
"value": false
},
"background": {
"stringID": "background",
"charID": "Bckg",
"id": 1113811815,
"key": 9,
"type": "DescValueType.OBJECTTYPE",
"value": {
"count": 3,
"typename": "ActionDescriptor"
},
"object": {
"red": {
"stringID": "red",
"charID": "Rd ",
"id": 1382293536,
"key": 0,
"type": "DescValueType.DOUBLETYPE",
"value": 255
},
"grain": {
"stringID": "grain",
"charID": "Grn ",
"id": 1198681632,
"key": 1,
"type": "DescValueType.DOUBLETYPE",
"value": 255
},
"blue": {
"stringID": "blue",
"charID": "Bl ",
"id": 1114382368,
"key": 2,
"type": "DescValueType.DOUBLETYPE",
"value": 255
}
}
},
"borderThickness": {
"stringID": "borderThickness",
"charID": "BrdT",
"id": 1114793044,
"key": 10,
"type": "DescValueType.UNITDOUBLE",
"value": 0
},
"bleed": {
"stringID": "bleed",
"charID": "Bld ",
"id": 1114399776,
"key": 11,
"type": "DescValueType.UNITDOUBLE",
"value": 0
},
"resolution": {
"stringID": "resolution",
"charID": "Rslt",
"id": 1383296116,
"key": 12,
"type": "DescValueType.UNITDOUBLE",
"value": 72
},
"vectorData": {
"stringID": "vectorData",
"charID": "",
"id": 1181,
"key": 13,
"type": "DescValueType.BOOLEANTYPE",
"value": true
},
"pagePosition": {
"stringID": "pagePosition",
"charID": "PgPs",
"id": 1348948083,
"key": 14,
"type": "DescValueType.ENUMERATEDTYPE",
"value": "pagePosCentered",
"enumerationType": "pagePosition"
},
"left": {
"stringID": "left",
"charID": "Left",
"id": 1281713780,
"key": 15,
"type": "DescValueType.UNITDOUBLE",
"value": 0
},
"top": {
"stringID": "top",
"charID": "Top ",
"id": 1416589344,
"key": 16,
"type": "DescValueType.UNITDOUBLE",
"value": 0
},
"scale": {
"stringID": "scale",
"charID": "Scl ",
"id": 1399024672,
"key": 17,
"type": "DescValueType.UNITDOUBLE",
"value": 100
},
"cropWhenPrinting": {
"stringID": "cropWhenPrinting",
"charID": "",
"id": 2922,
"key": 18,
"type": "DescValueType.BOOLEANTYPE",
"value": false
},
"cropRectBottom": {
"stringID": "cropRectBottom",
"charID": "",
"id": 2923,
"key": 19,
"type": "DescValueType.INTEGERTYPE",
"value": 0
},
"cropRectLeft": {
"stringID": "cropRectLeft",
"charID": "",
"id": 2924,
"key": 20,
"type": "DescValueType.INTEGERTYPE",
"value": 0
},
"cropRectRight": {
"stringID": "cropRectRight",
"charID": "",
"id": 2925,
"key": 21,
"type": "DescValueType.INTEGERTYPE",
"value": 0
},
"cropRectTop": {
"stringID": "cropRectTop",
"charID": "",
"id": 2926,
"key": 22,
"type": "DescValueType.INTEGERTYPE",
"value": 0
}
}
},
"printOutput": {
"stringID": "printOutput",
"charID": "",
"id": 1182,
"key": 40,
"type": "DescValueType.OBJECTTYPE",
"value": {
"count": 5,
"typename": "ActionDescriptor"
},
"object": {
"postScriptColor": {
"stringID": "postScriptColor",
"charID": "PstS",
"id": 1349743699,
"key": 0,
"type": "DescValueType.BOOLEANTYPE",
"value": true
},
"intent": {
"stringID": "intent",
"charID": "Inte",
"id": 1231975525,
"key": 1,
"type": "DescValueType.ENUMERATEDTYPE",
"value": "colorimetric",
"enumerationType": "intent"
},
"printSixteenBit": {
"stringID": "printSixteenBit",
"charID": "",
"id": 2695,
"key": 2,
"type": "DescValueType.BOOLEANTYPE",
"value": false
},
"printerName": {
"stringID": "printerName",
"charID": "",
"id": 1183,
"key": 3,
"type": "DescValueType.STRINGTYPE",
"value": "Lexmark X954"
},
"printProofSetup": {
"stringID": "printProofSetup",
"charID": "",
"id": 2696,
"key": 4,
"type": "DescValueType.OBJECTTYPE",
"value": {
"count": 1,
"typename": "ActionDescriptor"
},
"object": {
"builtin": {
"stringID": "builtin",
"charID": "Bltn",
"id": 1114403950,
"key": 0,
"type": "DescValueType.ENUMERATEDTYPE",
"value": "proofCMYK",
"enumerationType": "builtinProof"
}
}
}
}
},
"center": {
"stringID": "center",
"charID": "Cntr",
"id": 1131312242,
"key": 41,
"type": "DescValueType.OBJECTTYPE",
"value": {
"count": 2,
"typename": "ActionDescriptor"
},
"object": {
"horizontal": {
"stringID": "horizontal",
"charID": "Hrzn",
"id": 1215461998,
"key": 0,
"type": "DescValueType.UNITDOUBLE",
"value": 25
},
"vertical": {
"stringID": "vertical",
"charID": "Vrtc",
"id": 1450341475,
"key": 1,
"type": "DescValueType.UNITDOUBLE",
"value": 39.5
}
}
},
"hasBackgroundLayer": {
"stringID": "hasBackgroundLayer",
"charID": "",
"id": 3029,
"key": 42,
"type": "DescValueType.BOOLEANTYPE",
"value": false
},
"generatorSettings": {
"stringID": "generatorSettings",
"charID": "",
"id": 3016,
"key": 43,
"type": "DescValueType.OBJECTTYPE",
"value": {
"count": 0,
"typename": "ActionDescriptor"
},
"object": {

}
},
"targetPathVisibility": {
"stringID": "targetPathVisibility",
"charID": "",
"id": 3056,
"key": 44,
"type": "DescValueType.BOOLEANTYPE",
"value": true
},
"guidesVisibility": {
"stringID": "guidesVisibility",
"charID": "",
"id": 3057,
"key": 45,
"type": "DescValueType.BOOLEANTYPE",
"value": true
},
"smartGuidesVisibility": {
"stringID": "smartGuidesVisibility",
"charID": "",
"id": 3058,
"key": 46,
"type": "DescValueType.BOOLEANTYPE",
"value": true
},
"rulersVisibility": {
"stringID": "rulersVisibility",
"charID": "",
"id": 3059,
"key": 47,
"type": "DescValueType.BOOLEANTYPE",
"value": false
}
}
Most weird thing is that document ID is Raw-type.
That id is only the property's id, not the document id. As you can see in the object above, there is a "documentID" property which has the correct document id value.

What's interesting here is that you got a "document" property in your descriptor object, which should be a DescValueType.REFERENCE. That reference should be the document descriptor, but instead it's returned as a RAWTYPE. I've only seen RAWTYPE descriptors when the property is "legacyContentData", but this seems different. I still haven't figured out how to read those values.

Here's a post Davide started a while ago. Michael Hale had a way of reading these values, but I just don't get it yet.
https://www.ps-scripts.com/viewtopic.php?f=77&t=14414
User avatar
Jaroslav Bereza
Posts: 38
Joined: Tue Dec 27, 2016 7:22 pm

Re: Viewless document - examples?

Post by Jaroslav Bereza »

The biggest mystery for me is, how to target viewless document and perform there any action.
I have no idea how to use documenId to rarget actions into this document.

I suppose that I can have open multiple viewless at once and with rawType Id I can target viewless document which I want.
User avatar
Jaroslav Bereza
Posts: 38
Joined: Tue Dec 27, 2016 7:22 pm

Re: Viewless document - examples?

Post by Jaroslav Bereza »

I did some research and I am pretty sure that there is not any next stringID which contains word "viewless"

List of files which contains this word:
Image
Last three results means that this word exists in English dictionary where are almost every English words.

Localization strings:
Image
I am not sure why this has translation. Maybe it can appear in history panel?

Photoshop.dll
Image
This is probably related to translations.

Photoshop.exe
Image
Image
All 4 StringIDs from Stack script