download() should return the downloaded file
trych opened this issue · 7 comments
Just came across the fact that this method does not return the downloaded file, when it really should.
Hm. Looks like app.doScript
does not return anything.
We could guess if it worked with some try catch…
Needed lines are data.js#L1072 and data.js#L801
I think we can just after the download check if the file exists (usually it should) and if so, return this to the user.
+1 I'm starting to forget that ExtendScript is not async :-)
Well, but I realize now that this is not so easy: Say the download fails but a file of the same name was already there, then it would return this old file, which is incorrect.
Hm. Maybe we can additionally check some date stamp to find out, if the file in question was just created?
We could direct the output to a temp file and parser it
Ok, when we tackle this one, we just investigate which version works best and least hacky and then implement it this way.
As we still want to make the download version make for Windows anyways (#135), we probably should all develop this together to make sure the solutions work in all environments.