SAVE PDF File to Local Computer

I was wondering how I could save a PDF file within a URL. I am able to get to the URL and click the download button. However, once the popup to Cancel or Download shows up I can not click this button even with Xclic. Can I use any of the other options available to me to download the pdf file locally?

Hi @mc84usa ,
currently I have several problems using XClick, too.

Maybe you can try XType | ${KEY_ALT+KEY_S} instead of XClick?
(I’m not sure if it depends on the browser or settings.)

Hi Mc84usa,

I am using the following command:

"Command","executeScript_Sandbox"
"Target","var link = document.createElement('a');\nlink.href = 'YOUR_URL';\nlink.download = '';\nlink.dispatchEvent(new MouseEvent('click'));"
"Value",""

Does this help?
Best wishes
Anselm

I had to make a few revisions to your code, I am able to get the page to show up, however, the click to save is not working as the url is a forwarding url that takes me to a google drive url. Not sure if thats the problem or if i am not understanding the click.

Before your solution, I am able to get the file to download and the Save As screen from popping up in an Untitled Tab that has the SAVE Pop-Up as seen here Screenshot by Lightshot




{
  "Name": "test-1",
  "CreationDate": "2023-9-16",
  "Commands": [
    {
      "Command": "executeScript_Sandbox",
      "Target": "var link = document.createElement('a');\nlink.href = 'myurlhere';\nlink.download = 'Jenny Test';\nlink.dispatchEvent(new MouseEvent('click'));",
      "Value": "",
      "Description": ""
    }
  ]
}```

Did you try to leave

link.download = 'Jenny Test';

empty? For me the downoad is triggerd by this js…

I took your exact code and added a URL and cant get it to work can you provide the code you have working with a test file??

var link = document.createElement('a');
link.href = 'YOUR_URL';
link.download = '';
link.dispatchEvent(new MouseEvent('click'));```