It works:
set the destination_file to ((path to desktop as string) & "picture.jpg") as file specification
set thisImageSRC to "http://www.bungie.net/images/reachstats/commendations/gold/gold_large_precision_multiplayer.png"
tell application "URL Access Scripting"
download thisImageSRC to destination_file replacing yes
end tell
String processing is performed entirely with the change of Applescript text separators. To get the components of the URL in the list, you need to do the following:
set oldDelims to AppleScript text item delimiters
set AppleScript text item delimiters to "/"
set theUrlComponents to (every text item of theURL) as list
set AppleScript text item delimiters to oldDelims
Add salt to taste, but I agree with the first commentator that there are better languages for this. Applescript will be my last choice here.
source
share