Make a symbolic link from Finder

In a previous entry, I explained How to Sync Xcode’s Settings via Dropbox. This involves creating symlinks in Terminal, and cleverly moving files about.

You can’t create symlinks in Finder with what Apple provides you, but you can create an Automator workflow to do so easily.

  1. Create a new service in Automator.
  2. Select: Service receives selected files or folders in any application.
  3. Drag a Run Shell Script action.
  4. Shell: /bin/bash (Even if you’re using another shell as your default shell, this script is for bash.)
  5. Pass input: as arguments.
  6. Use this script:
     while [ $# -ne 0 ]; do
         ln -s "$1" "$1 symlink"
  7. The result should look like this:
    Dropbox Workflow

Alternately, you can download my finished service from Dropbox. It should be stored in ~/Library/Services.

You should now have a Make SymLink command when you right- or control-click a file or folder in the Finder:

Make SymLink menu command

You can even add a keyboard shortcut for it in System Preferences:

Services Shortcut Key

Remember: A symlink does not follow the original file if the original file moves on your hard drive.