Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

download() should return the downloaded file #323

Open
trych opened this issue Jan 21, 2019 · 7 comments
Open

download() should return the downloaded file #323

trych opened this issue Jan 21, 2019 · 7 comments

Comments

@trych
Copy link
Contributor

trych commented Jan 21, 2019

Just came across the fact that this method does not return the downloaded file, when it really should.

@ff6347
Copy link
Member

ff6347 commented Jan 29, 2019

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
Copy link
Contributor Author

trych commented Jan 29, 2019

I think we can just after the download check if the file exists (usually it should) and if so, return this to the user.

@ff6347
Copy link
Member

ff6347 commented Jan 29, 2019

+1 I'm starting to forget that ExtendScript is not async :-)

@trych
Copy link
Contributor Author

trych commented Jan 29, 2019

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?

@ff6347
Copy link
Member

ff6347 commented Jan 29, 2019

We could direct the output to a temp file and parser it

@trych
Copy link
Contributor Author

trych commented Jan 29, 2019

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.

@ff6347
Copy link
Member

ff6347 commented Jan 29, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants