Somebody asked my a question via email awhile back: Is it possible to open and manipulate an image file without it appearing on the screen.
At the time, I said "No". However....
I think I found a solution. Check out Presets/Scripts/Stack Scripts Only/StackSupport.jsx.
It is used by Presets/Scripts/Load Files Into Stack.jsx. In StackSupport, they have a bunch
of code centered around a ViewlessDocument class that they define. You open a viewless
doc with openViewlessDocument. You can't do any DOM manipulation of the doc.
Everything has to be done via Action Manager/Scripting Listener code.
I haven't used it directly. I was mucking around with the Load Files Into Stack script when I ran across this stuff.
It's apparently been sitting in there since CS4, maybe earlier.
ViewlessDocument
ViewlessDocument
What are the use cases? Is it faster?
It is faster except in the case where I needed to use it If you are loading a set of images from files into another image (like into a Contact Sheet, for instance) doing a Place/Transform operation is slightly faster than openViewless/copy/paste/close.
The person that I was swapping emails with needed to take snapshots of a document and save them out as jpegs during the middle of processing. ViewlessDocument provides a faster solution without having the UI clutter of creating a new document, copy/paste/save/close. I have some other scripts into which I may retrofit this functionality just so I have a better handle on it.
It is faster except in the case where I needed to use it If you are loading a set of images from files into another image (like into a Contact Sheet, for instance) doing a Place/Transform operation is slightly faster than openViewless/copy/paste/close.
The person that I was swapping emails with needed to take snapshots of a document and save them out as jpegs during the middle of processing. ViewlessDocument provides a faster solution without having the UI clutter of creating a new document, copy/paste/save/close. I have some other scripts into which I may retrofit this functionality just so I have a better handle on it.
ViewlessDocument
Thanks for sharing the info, xbytor!
I don’t know if I will get a grip on it or if I would actually need it, but it certainly sounds interesting.
I don’t know if I will get a grip on it or if I would actually need it, but it certainly sounds interesting.