Hoping someone can help with this computer problem. In the Finder on a Mac, you can view the files in List mode, so that various stats are shown about them. One of these is file size. I have several thousand files, and I would like to be able to get this information out easilly. I need it in a text file, so that I can insert it into a MySQL database. Does anyone know a shortcut or trick that would allow me to do this?
-b
There’s a little shareware program called, imaginatively enough, “List Files” that does what you want, and is fully configurable to include the info you want and not the info you don’t.
http://download.com.com/3000-2238-866936.html?tag=lst-0-3
Thanks rackensack! Almost perfect. Still, seems odd that there isn’t a Mac shortcut that would allow you to do the same thing…
-b
It is trivial under OS-X. Open a terminal window and type "ls -l " drag the folder icon from the title bar of the relevent window to the command line (this will paste the path for you) type “| cat>~/desktop/afilename.txt” and press return. Your file will appear, patiently waiting on your desktop. the command will look something like this:
ls -l /Macintosh\ HD/Users/yourname/yourfolder | cat>~/desktop/thefilename.txt
I’m afraid this might be hard to read, it starts “el es space dash el” and the symbol before space cat is called “pipe” it’s shift-key-above-return. If you need to strip out some of the garbage, we can sed that out too, let me know.
It is trivial under OS-X. Open a terminal window and type "ls -l " drag the folder icon from the title bar of the relevent window to the command line (this will paste the path for you) type “| cat>~/desktop/afilename.txt” and press return. Your file will appear, patiently waiting on your desktop. the command will look something like this:
ls -l /Macintosh\ HD/Users/yourname/yourfolder | cat>~/desktop/thefilename.txt
I’m afraid this might be hard to read, it starts “el es space dash el” and the symbol before space cat is called “pipe” it’s shift-key-above-return. If you need to strip out some of the garbage, we can sed that out too, let me know.
You can do it under MacOS 8 or 9 without any 3rd party software as well:
tell the application “Finder”
activate
set bryannmcc_rept to “Size in Bytes”
set myFolder to choose folder
set myPath to myFolder as string
set theItemNames to (list folder myFolder)
repeat with thisName in theItemNames
set theFullPath to alias (myPath & thisName)
select theFullPath
set theSelectedFile to selection
set FileSize to data size theSelectedFile as string
set theInfo to thisName & “–” & FileSize
set bryannmcc_rept to bryannmcc_rept & "
" & theInfo
end repeat
end tell
Stick that in your Script Editor!