Can't close a document using document.close!

,

It looks like you aren’t calling it with () after the method name

Try app.documents[1].closeWithoutSaving(); in the close function. Tested on my machine and it closes with no issues. If you still face errors, it may have to do with some other logic you’re using.