• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Adding download URL to a file's Get Info box
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding download URL to a file's Get Info box


  • Subject: Re: Adding download URL to a file's Get Info box
  • From: email@hidden
  • Date: Thu, 28 Oct 2010 19:28:30 -0700

On Oct 28, 2010, at 5:38 PM, Alex Zavatone wrote:

This script is pretty close to having it working.

Thanks, Alex.  This is exactly what I was looking for.  

I noticed that on some files there were 2 URL's; one for the file itself and another for the page from where the file was downloaded.  So I added some code to pick the page URL, if it's present.  If not, it grabs the file's URL.  This feature makes it better than the Safari plugin I was using before, as it only saved the files URL.

Thanks again,
Marc

on adding folder items to thisFolder after receiving someItems
if (count items of someItems) ≠ 1 then return
set itemAlias to (item 1 of someItems) as alias
do shell script "mdls " & (quoted form of (POSIX path of itemAlias))
set urls to the result
set oldDelimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to {"kMDItemWhereFroms"}
try
set urls to (text item 2 of urls)
set AppleScript's text item delimiters to {quote}

if (count urls's text items) ≤ 3 then
set urls to (text item 2 of urls)
else
set urls to (text item 4 of urls)
end if

set myFile to itemAlias as string
tell application "Finder"
set the comment of file myFile to urls
end tell
on error
set AppleScript's text item delimiters to oldDelimiters
return -- urls don't exist
end try
end adding folder items to
 _______________________________________________
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

  • Follow-Ups:
    • Re: Adding download URL to a file's Get Info box
      • From: Alex Zavatone <email@hidden>
References: 
 >Adding download URL to a file's Get Info box (From: email@hidden)
 >Re: Adding download URL to a file's Get Info box (From: Alex Zavatone <email@hidden>)
 >Re: Adding download URL to a file's Get Info box (From: Luther Fuller <email@hidden>)
 >Re: Adding download URL to a file's Get Info box (From: Alex Zavatone <email@hidden>)
 >Re: Adding download URL to a file's Get Info box (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: Adding download URL to a file's Get Info box
  • Next by Date: Re: Adding download URL to a file's Get Info box
  • Previous by thread: Re: Adding download URL to a file's Get Info box
  • Next by thread: Re: Adding download URL to a file's Get Info box
  • Index(es):
    • Date
    • Thread