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)

Participating Frequently
March 29, 2022

Yeah, actually I used to do that, but when you work with very heavy files, the pc freezes for some time. I found out that if I use the View-> Flip Horizontal, the load is very very low, fliping almost inmmediatly and not affecting the file itself. Consider I am an Illustrator, Fliping is not actully to "Actually Flip" its just to find out mistakes you could be doing. Flipping is something an artist do constantly, but not actually left the image flipped.

I work with the main file in one monitor (to zoom and work in details), and a secondary clone/document view in another. that keeps theimage in normal size, and some references that I may be using for anatomy and portraits in another screen too. Thats why I tried to do the "fast flip"in all documents at once, but flipping canvas in 3-4 documents just to see if Iam not drawing an eye lower than the other... too much time wasted. Well anyway if this is not actually possible, Ill do it one by one with a shortcut, at the end it is faster than the canvas flip.

c.pfaffenbichler
Community Expert
Community Expert
March 30, 2022

One can simulate keystrokes via Script so, if there would be only two instances of the open images (and no other open images) and you are working on the main-screen-instance of the image when triggering the Script, it might be possible to shift the focus via Script. 

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.