Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
> is there a method to read console output or to pipe that into variable, to check if a file exist?
No.
> Also is possible to make the "bHidden" parameter to work?
No. It seems to have been deprecated without being documented, which is very annoying, but not the first time it happens.