Reputation: 30985
Something like:
set the file_tgt to (path to downloads as string) as file specification
set file_src to "http://my_file.png"
tell application "URL Access Scripting"
download file_src to file_tgt
end tell
Upvotes: 4
Views: 7584
Reputation: 6244
To download a collection of files hosted in a directory using applescript and shell script -
set counter to 0
repeat 36 times
do shell script "curl -f 'http://stage.omatics.com/Images/Devices/Devices/" & counter & ".png' -o ~/Desktop/" & counter & ".png"
set counter to counter + 10
delay 2
end repeat
This will download these 36 files
http://stage.omatics.com/Images/Devices/Devices/0.png
http://stage.omatics.com/Images/Devices/Devices/10.png
http://stage.omatics.com/Images/Devices/Devices/20.png
--
--
http://stage.omatics.com/Images/Devices/Devices/350.png
at your desktop.
Hope this helps.
Upvotes: 0
Reputation: 30985
I found the solution myself:
set the file_tgt to (path to downloads folder as string) & "file.png"
Upvotes: 3