Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

des-01

macrumors newbie
Original poster
Sep 12, 2016
1
0
Edmonton
I am trying to install this script so that I can email links to co-workers of where files are on our shared NAS server.

tell application "Finder"

set theFile to item 1 of (get selection) as text

end tell


tell application "System Events"

set volumeName to volume of file theFile

set serverName to server of disk volumeName

if format of disk volumeName is AppleShare format and serverName is not missing value then

set filePath to POSIX path of file theFile

set afpPath to "afp://" & serverName & ".local/" & text 10 thru -1 of filePath

display dialog afpPath

else

display dialog "file " & theFile & " is not on a shared volume"

end if

end tell


But when I test the link out and email it to myself, I get an error message saying there was a problem connecting to the NAS server. But I am connected otherwise and can access all the files on there. What is wrong with my script?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.