Issue
I’m writing a plugin where I need to bake (create renditions of) the available artboards and
do some additional steps using the generated files.
I’m using application.createRenditions() and it all woks and generates the baked artboards.
The images are stored in the getTemporaryFolder().
Refer to the attached screenshot and log to see that the marked log line from the following code snippet is being printed and all meta information about the file seems correct.
The issue is that the next line calling file.read is failing silently:
- no errors in the console;
- there are no following log lines for the other files;
... application.createRenditions(bakeTasks) .then(() => { console.log('Baking done!'); let filePromises =[]; artboardArray.map(board => { filePromises.push( folder.getEntry(board.name + '.jpg') ); }); Promise.all(filePromises) .then(bakedFiles => { console.log('Opened files: ' + bakedFiles.length); let readPromises = []; bakedFiles.map(bakedFile => { // ######## console.log(bakedFile.toString()); // this log gets printed // ######## readPromises.push( bakedFile.read({format: formats.binary}) ); }); ... }); });
Steps to reproduce
- application.createRenditions(…);
- file.read({format: formats.binary});
Expected Behavior
I was expecting to get the file content.
Actual Behavior
The execution seems to have just stopped without any error or warning.
Log
Files prepared: 3
Baking 3 artboards.
Baking done!
Opened files: 3
{“name”:“screenA.jpg”,“type”:“file”,“nativePath”:“/var/folders/7d/_vxltf1s3tdg_1f70mzny80m0000gn/T/D1E81694-5CB4-4AA7-8B13-6FABDC01B416/xxxxxx/screenA.jpg”}