Cycle through open images


Could someone suggest a simple way to cycle through (in JavaScript with a for loop) open images with the purpose of taking a handle for each one and using it to invoke a method to change the image id?

Thank you very much,

The static "openWindows" property of ImageWindow will return an array containing all open windows. You can cycle through this to do what you want. For example, if you are just wanting to rename the main view and not any associated previews something along the following lines will work to rename open views to "whatever", "whatever1", "whatever2", ...

let windowArray = ImageWindow.openWindows;
for (let i = 0; i < windowArray.length; ++i)
    windowArray[i] = "whatever";

Hope this helps
Oook... but it says "We are working hard to complete a first online version of the PJSR Reference Documentation. Please stay tuned for updates on this page, and thank you for your patience."

Do you happen to have a direct link to the page you are referring to?


I think it has said that for a very long time - other things have taken priority!

It is not a weblink. Fire-up PixInsight then look for the View menu along the top and find Object Explorer in that menu. It will open the Object Explorer window in PixInsight.
Found it, and also script editor, that is around there, is quite convenient for "live" development and immediate test.

thanks a lot for the help.