Copy link to clipboard
Copied
- Acrobat Pro batch JavaScript
- includes the following line: stream = util.readFileIntoStream(path of textfile.txt)
- runs and completes OK
- if I then try to open textfile.txt with TextPad, I get a sharing violation
- I have to close Acrobat Pro to release the file
Question: how do I close the stream from within the batch script? Tried "stream.close()" but got a "not a function" error.
Copy link to clipboard
Copied
This shouldn't be necessary. Are you trying to open the file while the Action is running, though? I'm not sure that's a good idea...
Copy link to clipboard
Copied
Thanks for the response. No, the Action completes w/o problems before I try to open the text file. Maybe a little more detail may help:
- the text file contains a JSON hiearchy of directories and files that the Action processes
- the Action reads the file with util.readFileIntoStream(), then calls JSON.parse() to initialize the corresponding JS object
After the Action completes, if I try to open the JSON file in TextPad to make a quick manual change, TextPad gives me a sharing violation. I have to close Acrorbat Pro in order to make the change.