Fetch + app.doScript bug
InDesign / UXP
High Level Description
We have a plugin with the following behavior:
-
On an interval, run an app.doScript -
Fetch a file.
These behaviors together create some sort of time related bug. For large enough files (On my machine that means ~1MB), some of the binary data in that file will be rearranged, causing it to be corrupted or damaged.
Justification
If we could move away from app.doScript completely, we would. We need app.doScript primarily for the following reasons:
-
The ability to undo. -
XMP support in InDesign. -
The ability to support scripts that work on both InDesign server and InDesign desktop (UXP scripts are not where they need to be to make the switch). -
The ability to communicate with / open and run other Adobe applications.
Example
I’ve attached a zip with a minimal example plugin.
The plugin fetches files, hashes their contents, then outputs the hash. It does this multiple times for two different file sizes. On my Mac, the smaller file size works fine, but the larger file size will display different hashes (due to the binary data being rearranged). On my Windows machine, both fail.
If you comment out the last line (the setInterval), both file sizes work on Mac and Windows.
FetchDoScriptBug.zip (7.5 KB)