Copy link to clipboard
Copied
HI All,
My request is, download the url into the user selected destination location.
As of now, I can find the solution for download the url from Chrome via default download location.
But I am struggled, to downloaded the file into the user destination path.
Below is my code, I tried so far, Please help on this.
set downloadURL to text returned of (display dialog "Enter URL" default answer "" buttons {"Download", "Cancel"} default button 1)
set the destination to (choose folder)
tell application "Google Chrome"
activate
open location downloadURL
delay 1
--do shell script "curl -L " & downloadURL & " -o " & POSIX path of the destination --Help need here
end tell
Thanks
SS
If you just need to download the file in the destination folder then there is no need to use the browser, just the curl command should do. Try the following
set downloadURL to text returned of (display dialog "Enter URL" default answer "" buttons {"Download", "Cancel"} default button 1)
set the destination to (choose folder)
do shell script "curl -L " & downloadURL & " -o " & POSIX path of the destination & "demo.jpg"
-Manan
Copy link to clipboard
Copied
HI All,
My request is, download the url into the user selected destination location.
As of now, I can find the solution for download the url from Chrome via default download location.
But I am struggled, to downloaded the file into the user destination path.
Below is my code, I tried so far, Please help on this.
set downloadURL to text returned of (display dialog "Enter URL" default answer "" buttons {"Download", "Cancel"} default button 1)
set the destination to (choose folder)
tell application "Google Chrome"
activate
open location downloadURL
delay 1
--do shell script "curl -L " & downloadURL & " -o " & POSIX path of the destination --Help need here
end tell
Copy link to clipboard
Copied
Hi All,
Any help or ideas for my above request?
Thanks
SS
Copy link to clipboard
Copied
Hi All,
Any help or update or ideas for the above request.
Thanks
SS
Copy link to clipboard
Copied
Hi There,
I have merged your previous post on the same subject with this one, opening a new thread with the same query would not help. I don't delve too much into Applescript but the following seems to be working for me
set downloadURL to text returned of (display dialog "Enter URL" default answer "" buttons {"Download", "Cancel"} default button 1)
set the destination to (choose folder)
tell application "Brave Browser"
activate
open location downloadURL
delay 1
do shell script "curl -L " & downloadURL & " -o " & POSIX path of the destination & "demo.jpg"
end tell
-Manan
Copy link to clipboard
Copied
Hi Mannan,
Thank you for your swift reply..
Your timely help is much appreciated!
Will test and let you know shortly.
Copy link to clipboard
Copied
HI Mannan/All,
Yes.. your provided code helps to download the URL file in the destination location.
In that, I found two difficulties.
1. File is downloaded in both "choosing destination" as well as "default download location"
2. When the file is downloaded in destination, the name of the zip file should vary. (In default Download location, the name is as expected)
Thanks for your great support!
Regards
SS
Copy link to clipboard
Copied
If you just need to download the file in the destination folder then there is no need to use the browser, just the curl command should do. Try the following
set downloadURL to text returned of (display dialog "Enter URL" default answer "" buttons {"Download", "Cancel"} default button 1)
set the destination to (choose folder)
do shell script "curl -L " & downloadURL & " -o " & POSIX path of the destination & "demo.jpg"
-Manan