basiljs/basil.js

download() should return the downloaded file

trych opened this issue · 7 comments

trych commented

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

trych commented

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 :-)

trych commented

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

trych commented

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.

Maybe we can use something like nexe or pkg to stay in js land.