ViewlessDocument

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

xbytor

ViewlessDocument

Post by xbytor »

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.

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

theiviaxx

ViewlessDocument

Post by theiviaxx »

What are the use cases? Is it faster?
xbytor

ViewlessDocument

Post by xbytor »

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.
pfaffenbichler

ViewlessDocument

Post by pfaffenbichler »

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.