Created
June 11, 2013 19:44
-
-
Save judismith/5759969 to your computer and use it in GitHub Desktop.
This script prepends the parent folder name and " - " to all the children folders. It them moves the children folders to the same level as the parent folder.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Finder" | |
set thePath to (path to desktop folder as text) | |
set clientFolders to get name of folders of folder thePath | |
repeat with theFolder in clientFolders | |
if the theFolder starts with "_" then exit repeat | |
set matterFolders to get folders of folder (thePath & theFolder as text) | |
repeat with aFolder in matterFolders | |
set clientName to theFolder as text | |
set the name of aFolder to theFolder & " - " & the name of aFolder | |
end repeat | |
set matterFolders to get folders of folder (thePath & theFolder as text) | |
repeat with aFolder in matterFolders | |
move aFolder to thePath | |
end repeat | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment