Help with File Attributes & Shell Script

Posted:
Tue Sep 30, 2008 1:54 pm
by a_freyer
I would like to extract some data from a string stored in file attributes. Specifically there "wherefrom" attribute. I want to use the extracted string for renaming a file.
So far, shell scripts have come up bust for me as I'm not skilled at all.
So far, automator scripts don't seem to be able to retrieve attributes.
Hazel can't do this by default.
Any thoughts?
Re: Help with File Attributes & Shell Script

Posted:
Wed Oct 01, 2008 1:20 pm
by Mr_Noodle
You can try the 'mdls' command and scrape out the where froms from that using some combination of 'grep', 'cut' or 'sed'. It can get a bit involved though but I'd start there.
Re: Help with File Attributes & Shell Script

Posted:
Wed Oct 01, 2008 1:21 pm
by a_freyer
I'll see where that goes. Thanks.
Re: Help with File Attributes & Shell Script

Posted:
Thu Oct 02, 2008 3:16 am
by alastor933
This
automator action will list all metadata for selected files in a terminal window.
Look at the script inside to figure out how it's done.
Re: Help with File Attributes & Shell Script

Posted:
Fri Dec 05, 2008 5:23 pm
by sjk
alastor933 wrote:Look at the script inside to figure out how it's done.
That 7-line script is also shown on the
developer's site.