Copy link to clipboard
Copied
I'm trying to figure out where this is stored in the file structure, I've tried a few different options, but I'm stuck. I dumped all the attributes of the file to console, but it's not there.
Latest I tried this:
app.activeDocument.TiffSaveOptions)
I could simply open up each file and do a Save As Which would show me all the settings, but it's more time consuming than writing this to text.
Also, does anyone have a recommendation for an Object Model Viewer? Is there one? I'd like to learn more about the files and structures themselves, without having to do hours of experimentation, since it can be difficult to figure out where things are nested.
Copy link to clipboard
Copied
var compression = -1; // unknown
var rex = /\<tiff:Compression\>(.+)\<\/tiff:Compression\>/;
if (app.documents.length > 0) {
var xmp = String(app.activeDocument.xmpMetadata.rawData);
var m = xmp.match(rex);
if (m) {
compression = Number(m[1]);
}
}alert(compression);
Also, does anyone have a recommendation for an Object Model Viewer?
There is an OMV for JavaScript that comes built in to ESTK.
There is one PDF for the PS DOM and another for called the JavaScript Tools Guide.
I'd like to learn more about the files and structures themselves, without having to do hours of experimentation, since it can be difficult to figure out where things are nested.
There is a Photoshop Files Format PDF, also available on Adobe.com. I've used variants of it since the version that came out for PS6 many years ago.
But that stuff is not for the faint of heart.
Copy link to clipboard
Copied
Thanks again xbytor2! I use that OMV frequently, and had searched the JavaScript Tools Guide. I'll look for the other PDF though sounds great!
What I was wondering is if there were a viewer that showed the data in the file, yeah there would be a lot of random jargon, but it would be searchable at least to find a breadcrumb, similar to how you can open an Illustrator file in developer mode, when the file becomes corrupt, so you may extract the offending code.
The main issue I face, as is with all scripting languages I don't know exactly where things are stored, and although i created a dump function that loops through an object, it's still a guessing game. The OMV, and PDFs are always great but sometimes drop you 30 miles from your answer. Granted, I may need to read the "how to use" text at the beginning to fully understand. Problem being, I love coding, but hate reading.