Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
You mean when you choose View > Flip Horizontal and switch to the mirrored instance of image you can for example transform it faster than doing it on originaly opened image?
Copy link to clipboard
Copied
View-> Flip Horizontal just flip your view of the image but the image itself is not changed. I meant that if I do it in the classical way, the software takes too long cause it actually edit the image. Literally I have to see the progress bar to do the changes, view version is almost instantaneous. And I usually have more than 1 big file open (usually around 3) + extra instance so it takes more time.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
With VBScript 😉
Copy link to clipboard
Copied
I kind of thought about it (and I found your other post answer too, the VBScript, before posting here), but I dont know if there is a way to count the number of open windows in the program, the instances? Cause if I have more than 1 file open it wouldnt work as expected, i would have to make sure I am in the right window and I work with more images, I would have to anyways change manually to the right window to start the script... so it goes back to the change all with script and the intances (usually 1) manually.
Copy link to clipboard
Copied
Autohotkey should be able to count the windows.
Copy link to clipboard
Copied
but I dont know if there is a way to count the number of open windows in the program, the instances?
By @juanalbertoart
Create a temporary empty small document. Remember its id. After that, send the CTRL+TAB press event to Photoshop using an external script or program. Check the id of the active document. If it matches, end the loop.
Something like this : )
Copy link to clipboard
Copied
Shouldn’t
app.activeDocument = app.documents;
be
app.activeDocument = app.documents[i];
?
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now