Help with File Attributes & Shell Script

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

Moderator: Mr_Noodle

Help with File Attributes & Shell Script 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?
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

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.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Help with File Attributes & Shell Script Wed Oct 01, 2008 1:21 pm • by a_freyer
I'll see where that goes. Thanks.
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

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.
alastor933
 
Posts: 53
Joined: Wed Mar 05, 2008 3:52 pm
Location: Utrecht, Netherlands

Re: Help with File Attributes & Shell Script 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.
sjk
 
Posts: 332
Joined: Thu Aug 02, 2007 5:43 pm
Location: Eugene


Return to Support