Executing
open afp://server.example.com/share/top-folder/sub1/sub2
Will open the share - and, if the share was already mounted, ignore the rest of the path.
So, here's a quick command (make sure it's all one one line) that will open the subfolder, whether the share is already mounted or not:
if [ -d /Volumes/share ]; then open /Volumes/share/top-folder/sub1/sub2 ; else open afp://server.example.com/share/top-folder/sub1/sub2 ; fi
Adaptation for other protocols (ex: SMB), other mountpoints and error-checking are left as an exercise for the reader. :)
No comments:
Post a Comment