Take the 2-minute tour ×

I use a lot of aliases in my file system. Many original documents are placed in global repositories and I access them by aliases grouped in "tag" folders. Therefore, when I need to delete such a document, I need to check multiple tag folders to remove the aliases, which pains.

Is there an application that can check for broken aliases in Finder (or preferably, a particular folder)? Thanks in advance.

share|improve this question
I'm not at my Mac to test this fully, but I believe that by using the command in a previous SU answer along with Hazel, you can create a rule to either alert you to broken links, color them, delete them, etc. –  fideli Jan 5 '13 at 7:55
@fideli find -L . -type l -ls only works with symlinks. –  user3936 Jan 5 '13 at 23:08
@LauriRanta Whoops, I thought Finder aliases are simply symlinks. Perhaps not. –  fideli Jan 6 '13 at 0:31
add comment

1 Answer

up vote 1 down vote accepted

Try running something like this in AppleScript Editor:

set l to {}
tell application "Finder"
        alias files of entire contents of (POSIX file "/Users/username/Folder/" as alias)
        -- zero aliases results in an error, one alias is not returned as a list
        result as list
    on error
    end try
    repeat with f in result
            original item of contents of f
        on error
            --move contents of f to trash
            set end of l to POSIX path of (f as text)
        end try
    end repeat
end tell
set text item delimiters to linefeed
l as text
share|improve this answer
Awesome script. Thank you so much. –  KevinSayHi Jan 6 '13 at 5:59
add comment

Your Answer


