app.openDoc() return something to JavaScript console even using try{} catch {}
I tried using app.openDoc to test wether a file exist or not, like this
It does work (although bHidden set to true is ineffective)... unless a file doesn't exist or there is an open handle of the file in another application. In both cases,it returns the same NotAllowed error, so using try{} catch {} to discern between both cases is useless. However, if file doesn't exist, it prints that directly in console, regardless of where the script is (batch, document or folder level) and how i try to escape this. I can only clear console with console.clear(), but i didn't find a way to catch this. So the question is: is there a method to read console output or to pipe that into variable, to check if a file exist? Also is possible to make the "bHidden" parameter to work?
