|
|
Would rather ADD 'Where From' metadata TO files
I would find the opposite of this more useful - i.e. a way to add a "where from" attribute to a file, for example, if you copy some of a webpage into a TextEdit document and then save that; it would be convenient to attach the originating URL to that file. I currently do this simply by pasting the URL somewhere into the text of the file itself but to be able to add it as metadata would be fantastic! Anyone who puzzles this out could contribute a great Mac OS X Hint! (Or maybe it's already been done and I missed it?) Ah, yes, after some playing around:
Note there is an error in the line which reads:
It should read:
g=Edited on Dec 08, '10 09:19:22AM by gabester
Would rather ADD 'Where From' metadata TO files
xattr --help will give: xattr -w [-r] [-v] [-x] attr_name attr_value file [file ...].
Hence, to ad the attribute, run (in a Terminal window): xattr -w com.apple.metadata:kMDItemWhereFroms http://www.foo.com/ filenamePS: The "delete" step in the original hint has the attribute name incorrect. It should be: xattr -d com.apple.metadata:kMDItemWhereFroms /Path/To/FileMichael
Would rather ADD 'Where From' metadata TO files
Thanks for this. It is useful knowledge for me.
Would rather ADD 'Where From' metadata TO files
Thanks! I've corrected the error in the hint.
Would rather ADD 'Where From' metadata TO files
My bad. I was a little tired that evening :-/ ---
http://groups.google.com/group/applescripters/ http://qgf.in/ http://www.kompilesoft.info/
Re: Would rather ADD 'Where From' metadata TO files
I'd been looking for the same thing for a while now and also somehow missed -w in the xattr help; thanks so much for poking around and posting this!
Re: Would rather ADD 'Where From' metadata TO files
How did you get xattr help? When I ask man for help with xattr, nothing good happens. I had to follow a tutorial to learn about -d. ---
http://groups.google.com/group/applescripters/ http://qgf.in/ http://www.kompilesoft.info/
Re: Would rather ADD 'Where From' metadata TO files
xattr -h
Re: Would rather ADD 'Where From' metadata TO files
Ah, I remember now what my problem was before: xattr -w does set kMDItemWhereFroms, but does so in an invalid format (this particular attribute should be some form of binary plist, not a string). Thus the Finder and Spotlight/mdls don't recognize the attribute and don't display it.
Would rather ADD 'Where From' metadata TO files
I have a script that runs this twice with a grep to remove all the extended attributes from all the files in a directory tree. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|