I'm trying to create a progress bar function but the code below creates 6 instances of the progress window rather than updating the info in the first window. I've gone the for loop process to make progress bars work is this the only way it can be used or is there a way to tell if a window is open on if so update the bar and info of that window?

ScriptUI needs some time to get used to :-) A 'simple' progress bar was also my very first try and I think I made similar mistakes. But nothing to worry about.

The reason you get more than one window, of course, is this line in your function:

myWindow = new Window ..

(and subsequently myWindow.show();)

You should create the window (and usually, immediately show it) somewhere at the beginning of your script in an initialization phase. That'll pop up the window in the state you created it. Make the variable holding the window a global one, so you can access it even when using functions to 'drive' it.

In your update loop, you should only change the elements: myProgressBar.value, myStaticText.text, and myWindow.text. ScriptUI is smart enough to check if the elements are on screen, and changes them immediately.