Are there any other ways to open document in an existing window rather than closing the current document?

I've got another question as well. When I'm running a batch sequence with JavaScript code Acrobat asks me to proceed on each file with JavaScript Editor window showing the script code. How can I skip this or avoid appearing of this window?

So are there any other ways to open the document in an existing window rather than closing the current document? I'm trying to replicate through javascript the Open Preference of "Window set by user preference" as when you create the Action Open a file.