how to move/make a new window underneath the other windows


I have a script that creates a window (it’s a script) so it uses a command from the library:

set theWindow to make new message viewer with properties {visible:true}

Now the window appears at the top of all windows, which is I assume the end of the list of (all or just windows.
How can I put it at the start of the windows – ie at the bottom.

move window index of theWindow to beginning of the windows

Would that do it or do I have to do it another way?


I tried :

set myindex to index of theWindow
move window myindex of the windows to beginning of the windows

but it doesn’t work.