Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to generate a list of folders in a drive?

Hi and thanks in advance for your help.


I have a MBP running Mac OS X 10.7.5.


I frequently backup my media (music, movies, etc.) on external hard drives (about 500GB).


I would like to have a file that lists all the folders and subfolders on a drive.


I have found several threads with command lines and scripts but none of them have worked.


I hope someone can help me with this !


Thanks !

MacBook Pro, Mac OS X (10.7.4)

Posted on Jan 30, 2013 3:39 PM

Reply
Question marked as Best reply

Posted on Jan 30, 2013 4:58 PM

The best I've found at the moment is http://www.jonn8.com/html/scripts/misc/List_Folder_Contents.html, however, it maps both files and folders, so I'm working on changing that.


Edit: It seems like the following script I wrote will work; I'm not sure as it also maps the folders within an app, and sine I have a few apps, it still hasn't finished yet.



property kFileList : {}


set source_folder to "Macintosh HD" as alias

my createList(source_folder)


on createList(item_list)

set the the_items to list folder item_list without invisibles

set item_list to item_list as string

repeat with i from 1 to number of items in the the_items

set the_item to item i of the the_items

set the_item to (item_list & the_item) as alias

set this_info to info forthe_item

set file_name to name of this_info

set end of kFileList to file_name

if folder of this_info is true then

my createList(the_item)

end if

end repeat

end createList


2 replies
Question marked as Best reply

Jan 30, 2013 4:58 PM in response to Narcisse2

The best I've found at the moment is http://www.jonn8.com/html/scripts/misc/List_Folder_Contents.html, however, it maps both files and folders, so I'm working on changing that.


Edit: It seems like the following script I wrote will work; I'm not sure as it also maps the folders within an app, and sine I have a few apps, it still hasn't finished yet.



property kFileList : {}


set source_folder to "Macintosh HD" as alias

my createList(source_folder)


on createList(item_list)

set the the_items to list folder item_list without invisibles

set item_list to item_list as string

repeat with i from 1 to number of items in the the_items

set the_item to item i of the the_items

set the_item to (item_list & the_item) as alias

set this_info to info forthe_item

set file_name to name of this_info

set end of kFileList to file_name

if folder of this_info is true then

my createList(the_item)

end if

end repeat

end createList


How to generate a list of folders in a drive?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.