Dec 01, '06 07:30:01AM • Contributed by: mistersquid
on open (docpath)
tell application "Finder"
activate
set docpath to docpath as text
set search_string to ":"
set replacement_string to "/"
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to the search_string
set docpath to text items of docpath
set AppleScript's text item delimiters to the replacement_string
set docpath to text items of docpath as text
set unixpath to "/Volumes/" & docpath
set AppleScript's text item delimiters to the oldDelims
end tell
if last text item of (unixpath as text) is equal to "/" then
set unixpath to (text 1 through ¬
((length of unixpath) - 1) of unixpath)
end if
do shell script "ln -s " & quoted form of unixpath & " " & ¬
quoted form of unixpath & ".sym"
end open
Save the file as a Run Only application (with or without Startup Screen). When you drop a file or folder onto the resulting application, a symbolic link will be made in the same directory as the file, with the extension .sym. I'm sure there are ways to improve on this script (e.g. batch functionality), and I look forward to what other MacOSXHints community has to say.
[robg adds: This worked as described in my testing. If you work with symbolic links and aliases in Terminal and Finder, there are a few other hints here that might be of interest: A script to reveal alias paths in the Terminal, A script to convert aliases to symlinks, Enable 'cd' into directory aliases from Terminal.]
