Download File without clicking button

Hi,

I have created a script that generates a file and can be download by clicking a link/button. Please see screenshot below:

Now, what I want is to do is download the file without clicking the link. Any ideas how I can achieve that?

Regards,
John

Try something like below once the link is generated. It should download the file.

window.open(“file_url”, “_blank”)