Making Safari wait for download to finish

I wrote a trivial script that is a sequence of four “open location”. The script is:

open location “http://site/url1
open location “http://site/url2
open location “http://site/url3
open location “http://site/url4

The problem is that each of these url’s causes an MP3 to download. If I just run the script, all four downloads start at the same time. Is there a way to wait for the first download to finish before starting the second?

You could use IE, which has a pref for concurrent downloads.

You could loop until the .download file goes away if you know what it’s going to be called.