tags:

views:

205

answers:

1

Hi there

Is there a way to retrieve the server path name of the selected item within finder with applescript?

I've tried the properties URL and POSIX path but they just point to the local file system instead of the server path for example: smb://server/folder1/folder2/filename

code so far:

tell application "Finder"
    set selectedItem to the selection as alias
    URL of selectedItem --ouput: file://localhost/Volumes/server/folder1/folder2/filename
    POSIX path of selectedItem --output: /Volumes/server/folder1/folder2/filename
end tell

thanks for the help

+1  A: 

I think this has to do with the way directories work in OS X (and every *nix). AFAIK there are no UNC style paths on a mac. So the only workaround is to make a database of the available windows shares, look up the name of the volume of the file and spit out a 'file://some/server/path' style URL based on that.

At least that's what I did when I had the same problem. Note that smb:// urls won't work for most web apps.

this and this shed some light on to it.

stib