Last active
December 21, 2015 06:59
-
-
Save foo9/6267702 to your computer and use it in GitHub Desktop.
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
| on work_folder(the_path) | |
| tell application "Finder" | |
| set the_files to every file of the_path | |
| repeat with afile in the_files | |
| peel_label(afile) of me | |
| end repeat | |
| set the_folders to every folder of the_path | |
| repeat with afolder in the_folders | |
| peel_label(afolder) of me | |
| work_folder(afolder) of me -- 再帰呼び出し | |
| end repeat | |
| end tell | |
| end work_folder | |
| -- ラベルをはがす | |
| on peel_label(folder_or_file) | |
| set posix_path to POSIX path of (folder_or_file as string) | |
| log (posix_path) | |
| tell application "Finder" | |
| -- ラベルを設定(0: ラベルなし) | |
| set label index of folder_or_file to 0 | |
| end tell | |
| end peel_label | |
| on run | |
| try | |
| set chosen_folder to choose folder | |
| work_folder(chosen_folder) | |
| end try | |
| end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment