Skip to main content
Participating Frequently
March 27, 2022
Question

Apply "View - Flip Horizontal" to all open windows (including clones)

  • March 27, 2022
  • 3 replies
  • 921 views

Ive been trying to apply the View -- Flip Horizontal to all my open documents when working in some illustrations with an Script (the script is pretty simple). My problem is that the script sequentially jumps through the documents, but the "clone documents/windows" does not appear as a new document (because it is just a new window that mirror the document). For reference is when you do window -> arrange -> new ****.PSD

This is my code:

var idflipViewHorizontal = stringIDToTypeID( "flipViewHorizontal" );  
var workingDocument = app.activeDocument;  
for (var i = 0; i < app.documents.length; i++)  
{
app.activeDocument = app.documents;  
var docRef = app.activeDocument;

runMenuItem(idflipViewHorizontal);
};  
app.activeDocument = workingDocument;

But this just cycle through documents, and I think I need cycle through open windows/ document tabs, to apply the "view effect" cause this view -- flip horizontal doesnt actually change the doc, it is just a view mode.

This topic has been closed for replies.

3 replies

c.pfaffenbichler
Community Expert
Community Expert
March 28, 2022

Shouldn’t 

app.activeDocument = app.documents;  

be 

app.activeDocument = app.documents[i];  

Participating Frequently
April 1, 2022

Yeah actually I think I erased that part when paste it here by accident, but it has it in the script. The way you say it is the correct one.

Legend
March 28, 2022

Windows with document views are not documents themselves. That is, they cannot be switched by script or action in the usual way.

Perhaps instead of flipping the canvas horizontally via the view menu, you should use a similar transform command on the edit menu (it will actually flip the canvas and it will show up in all linked windows)

Kukurykus
Legend
March 28, 2022

Once I wrote autohotkey script that probably is usless for this problem, but I remember it did with new window for document that what Photoshop scripting couldn't do: Access to document windows, tabs

Participating Frequently
March 27, 2022

Ah I think I didnt Express that what I need is a way to change via script, the focus of the window, so I could change the view properties of it.