Re: Adding download URL to a file's Get Info box
Re: Adding download URL to a file's Get Info box
- Subject: Re: Adding download URL to a file's Get Info box
- From: Luther Fuller <email@hidden>
- Date: Thu, 28 Oct 2010 15:21:37 -0500
Steve got me thinking about this. There used to be an app that would place the download URL in the Get Info box of each file you downloaded with Safari, but it no longer works.
Could you do the same thing with AppleScript? It's pretty handy to know where a file came from months afterwards when you can't remember why you downloaded it.
Open terminal, type 'mdls ' followed by the path to a downloaded item (drag & drop). At the bottom of the resulting information you will find ...
kMDItemWhereFroms
which contains the source URLs. Using a little 'do shell script ...' in an AppleScript, you can easily get this info.
Try this. It's a crude quickie, but it works for many files.
on open dropList if (count items of dropList) ≠ 1 then return set itemAlias to (item 1 of dropList) as alias do shell script "mdls " & (quoted form of (POSIX path of itemAlias)) set urls to the result set AppleScript's text item delimiters to {"kMDItemWhereFroms"} try set urls to (text item 2 of urls) on error return -- urls don't exist end try display dialog (itemAlias as text) default answer urls end open -------------
You need to add more formatting code to clean up the returned text.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden