convert flat toc to mac style finder structure