getting "source url / address" to work with firefox

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

As many people seem to have realized-- and much to my extreme frustration-- the "source url/ address" feature of Hazel only seems to work with Safari or Mail because Firefox (my browser of choice) and others do no write "where from" metadata.

My goal here is to get some workaround going so that we can achieve the same functionality (i.e. automatic writing of source metadata) with FF and applescripts or whatever we need to make it work so Hazel can do it's source url / address goodness to our files after.

There is one person here who said they had a shell script that did this. I tried it and it didn't work, but I am out of my depth so maybe I am just doing it wrong. How does one even run a shell script? hah. I'm clearly not the one who should be trying to figure all this out.

However, I did figure out that if you enter the following into Terminal, you can write this field manually (in the following example i'm telling it that 038588.pdf is from google.com):

xattr -w 'com.apple.metadata:kMDItemWhereFroms' '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><array><string>http://www.google.com</string></array></plist>' /Users/yourname/Desktop/somefolder/038588.pdf

That is a start, at least. Now all I need is someone smart to write an automator thing or a firefox extension or a greasemonkey userscript or something to make this happen automatically using firefox's knowledge of where the file is being downloaded from.

...HALP?

PS
these people and these people seem to be onto something but it's over my head...
north45
 
Posts: 4
Joined: Mon Apr 15, 2013 11:39 am

north45 wrote:xattr -w 'com.apple.metadata:kMDItemWhereFroms' '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><array><string>http://www.google.com</string></array></plist>' /Users/yourname/Desktop/somefolder/038588.pdf

Wouldn't this simpler command be sufficient?

Code: Select all
xattr -w com.apple.metadata:kMDItemWhereFroms http://www.google.com /Users/yourname/Desktop/somefolder/038588.pdf

The mdls -name kMDItemWhereFroms … result looks the same. Or this for a multi-item array:

Code: Select all
xattr -w com.apple.metadata:kMDItemWhereFroms 'http://www.google.com, ""' /Users/yourname/Desktop/somefolder/038588.pdf
sjk
 
Posts: 332
Joined: Thu Aug 02, 2007 5:43 pm
Location: Eugene

Since lots of people have been asking about this, I figured I'd whip up something quick. Answer in the Tips/Tricks Forum here.
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado


Return to Support