How to print a list of folder contents with all attributes ?

Discussion in 'Mac Basics and Help' started by Ah Arroz, Sep 27, 2010.

  1. Ah Arroz macrumors newbie

    Sep 27, 2010
    Hi there,

    I've come to my wit's end now - I've got about 10K plus of photos in my folder which I have nicely organized and grouped with different labels and comments. I would like to now convert the list of files with all attributes into a document. I've tried the copy and paste tricks with Textedit as well as several folder actions offered in Automator -to no avail as all I've got is just a list with file names which is more or less useless to me. It seems that during the process only the files names are copied but not other infos like label, size etc. Is there something I have missed here? I would be extremely grateful if someone could throw some light here.

    Thank you
  2. GGJstudios macrumors Westmere


    May 16, 2008
  3. LPZ macrumors 65816

    Jul 11, 2006
    You want to create a text document that lists each file in a folder, along with color of the file's label and the file's Spotlight/Finder comments? (Any other info too?) If so, a script that uses the mdls Terminal command seems one way to go. But maybe there's some third-party app/utility that does this?
  4. Gregg2 macrumors 603

    May 22, 2008
    Milwaukee, WI
    These attributes:
    In other words, the whole row, whatever columns are active in List View.

    I don't know a "trick". If it's possible, I'm sure it takes an application written specifically for such things.

    So, does anyone know of some kind of Finder manipulation software that will list ALL the items from List View in a text editor?
  5. LPZ macrumors 65816

    Jul 11, 2006
    It can't be hard to write a script that does this using the mdls command. Don't have time right now. Maybe someone else does. ;)
  6. Ah Arroz thread starter macrumors newbie

    Sep 27, 2010
    Thanks all for the input so far - no script expert myself I'll just have to wait for some experts to come along to land me a helping hand:(
  7. LPZ macrumors 65816

    Jul 11, 2006
    OK, here's a very crude solution:

    1) Open Terminal (in Utilities)

    2) In Terminal, type (but don't press return) the following:

    3) Drag the folder that contains your files into the Terminal window and drop it there. (Your folder isn't actually being moved anywhere, but its location in your filesystem is being appended to the cd command you typed in step 2) above.)

    4) Click on the Terminal window to make it active and then press return.

    5) In Terminal, enter the following and press return:

    (That's lowercase L lowercase S.)

    6) You should see a list of the files for which you want the attributes printed. If not, you did something wrong in the steps above. Try again. :)

    7) Assuming the list is correct, copy and paste the following into Terminal. You may need to press return to enter the command.

    for file in `ls`; do mdls -name kMDItemDisplayName $file; mdls -name kMDItemContentCreationDate $file; mdls -name kMDItemFSSize $file; mdls  -name kMDItemFinderComment $file; mdls -name kMDItemFSLabel $file; echo ""; done > ListOfFiles.txt
    8) A file named ListOfFiles.txt should appear in the folder that contains your other files. You should be able to double-click on this text file to open it. For each file, you should have the name, creation date, file size (in bytes), file comments and a code indicating the color of the file's label (0=none, 1=gray, 2=green, 3=purple, 4=blue, 5=yellow, 6=red, 7=orange).
  8. Ah Arroz thread starter macrumors newbie

    Sep 27, 2010
    Thanks but I am really stuck at stage 1 - I open Terminal as you suggested and type in cd followed by dragging the folder that contains the photos - upon typing return it just says it's an invalid directory. I tried without typing cd and it returns saying it's a valid directory. Typing ls just gives me the list of items in my home folder only. Does it matter if my photo folder resides on another partition of the same drive that my OS (Mac 10.5.8) is ?

Share This Page