Create a symbolic link in the Mac OS X Finder

Solution 1:

What about that creating symbolic links in the Finder via AppleScript ?

Here's the most relevant script in that link:

on run
    open {choose file with prompt "Choose a file to create a symbolic link:" without invisibles}
end run

on open the_files
    repeat with i from 1 to (count the_files)
        try
            set posix_path to POSIX path of (item i of the_files)
            if posix_path ends with "/" then set posix_path to text 1 thru -2 of posix_path
            do shell script "ln -s " & quoted form of posix_path & " " & quoted form of (posix_path & ".sym")
        end try
    end repeat
end open

Just paste it into AppleScript Editor and save it as an application. Then you can drag it over your finder's toolbar or link it on the dock.

Solution 2:

SymbolicLinker will do exactly what you're looking for, and it's free.

alt text

Solution 3:

An applescript at the link provided by user nuc answered my question. Here is the applescript reproduced in case that link disappears.

I preferred the script given by the commenter jonn8n, which was also reproduced as Macworld article.

on run
    open {choose file with prompt ¬
        "Choose a file to create a symbolic link:" without invisibles}
end run
on open the_files
    repeat with i from 1 to (count the_files)
        try
            set posix_path to POSIX path of (item i of the_files)
            if posix_path ends with "/" then set posix_path to ¬
                text 1 thru -2 of posix_path
            do shell script "ln -s " & quoted form of posix_path ¬
                & " " & quoted form of (posix_path & ".sym")
        end try
    end repeat
end open

I saved this as an application using Script Editor and dragged the application to the Finder sidebar so I can now create symbolic links by dragging files or folders onto the application icon.

Solution 4:

Path Finder adds this to your Finder, and adds a lot more features.

Solution 5:

Use Automator.app to create a Service that executes a bash script. This is simpler than AppleScript and more reliable than installing third-party software.

for f in "$@"
do
    ln -s "$f" "$f.symlink"
done

Make Symbolic Link.workflow

Then you can access the Make Symbolic Link command under the Services menu:

enter image description here

The result:

enter image description here