<pre>-- This function returns a line-delimited list of folder paths.-- This function is recursive, so it will find all of the folders in an HFS.-- The starting point is a folder path, too.function getFoldersRecursively rootFolder  ---  put rootFolder into basePath  put rootFolder & return into cat  ---  put listFolderNames(rootFolder) into mainCat  if mainCat is empty then return empty  repeat with x = 1 to the number of lines of mainCat    put basePath & (line x of mainCat) & ":" & return after cat  end repeat  ---  repeat with x = 2 to the number of lines of cat    put getFoldersRecursively(line x of cat) into newFolders    if newFolders is not empty then put newFolders & return after cat  end repeat  ---  repeat with x = the number of lines of cat down to 1    if line x of cat is empty then delete line x of cat  end repeat  ---  sort lines of cat  repeat with x = the number of lines of cat down to 1    if line x of cat is line (x-1) of cat then delete line x of cat  end repeat  ---  return cat  ---end getFoldersRecursively</pre>