Jag fick inte Localhost men man får byta ut fil:///Volumes mot afp://server för att få hela adressen. Att få adressen via script är inte helt trivialt verkar det som. Finder visar visserligen adressen i Get Info, men det är inte lätt att veta var man kan hämta den.
Här är en variant som helt enkelt hämtar texten i Get Info-fönstret. Men jag misstänker att det finns fallgropar beroende på hur "filytan" är ansluten och om sökvägen har konstiga tecken. Saxat från Ars Technica. Fungerar för mig på afp-filer, men inte på lokala filer. Finns även en Python-version, men den hann jag inte få att rulla i Applescript men det klarar du nog.
tell application "Finder" set w to open information window of (selection as alias)
tell application "System Events"
tell process "Finder"
set m to value of static text 14 of scroll area 1 of window 1
set output to ReplaceText((m as string), " ", " ") of me
end tell
end tell
close information window of (selection as alias)
set the clipboard to output as text
end tell
on ReplaceText(theString, fString, rString)
set current_Delimiters to text item delimiters of AppleScript
set AppleScript's text item delimiters to fString
set sList to every text item of theString
set AppleScript's text item delimiters to rString
set newString to sList as string
set AppleScript's text item delimiters to current_Delimiters
return newString
end ReplaceText