littlehorse3 wrote: I know about app.documents array. But it contains documents in opening order. |
Yes in the order that the document were open or created in Photoshop. You can also find the document names if the new or need to be saved etc. if you want the change their order I would think you may need to save the ones that need saving close all document then open the documents in the order you want them in. You can process the documents in any order you want. I do not edit in Tabs. If you are trying to change the document tab order which you can do using Photoshop UI by dragging the tab order. Adobe Scriptlistener plug-in does not record that event so I do not think you can script changing the tab order any way other than closing all the open document then opening them in the order you want them to be in. Not a good thing to do.
Previous and next document is actions are relative the the active document position in the document array the code also treats the order as a ring next after the last open document is the firs open document. Adobe warns you if you create action that use previous and next if you open additional document in the action Next and previous may not work the way you expect. Adding Document can change which document is next and previous.
If you have 10 open document in Photoshop so the are element 0 through 9 in the document array your working on document[4] it is the active document. If you run a script and it opens new document document[10] element is added and become the active document document[10] the script is still in control and can make document[4] again work it and then switch to any other open document using some logic. Action can only switch using previous and next action need to know the order of the document and know what happens to the order when the change the order closing and opening document if an action uses a script or plays an other action it better know what the scrip or action does the the number of open documents. Previous and Next work on documents the are open if documents are open and document are close. What is Previous and Next can change. Actions can only do step step step nor the there are also conditional action steps the involve other actions using Previous and Next can be quite complex. Scripts can use logic the can leave notes in document metadata to help processing.
I also do not know for sure what you mean when you write Select 'real' next document? what makes any next document UnReal?