Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the '10.6: Copy URLs from downloaded files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Copy URLs from downloaded files
Authored by: Fenton on Mar 04, '10 08:37:50AM

I guess Safari writes it to the metadata for the file downloaded. I have the following AppleScript (I got the command line from somewhere), saved as an application, which I drop download files onto. It puts the URL path(s) onto the clipboard (as I'm usually doing this to save a link to email someone):

on open (file_drop)
set file_alias to item 1 of file_drop
set pos_file to quoted form of POSIX path of file_alias

set URLs to do shell script "/usr/bin/mdls -name kMDItemWhereFroms " & pos_file & " | egrep 'http:'"
-- download URL, could be more than 1 line
set the clipboard to URLs
display dialog "The URLs are on the clipboard" buttons {"OK"} default button 1
end open

FileMaker Developer
San Diego

[ Reply to This | # ]