Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Yosemite run "mount volumes" is not same as Mountain Lion

I have a script to mount the shared folder from Windows server (named: servicedesk) as a volume in Yosemite iMac.

-- -------begin script-----

set loggedInUser to do shell script "whoami"

tell application "Finder"

try

mount volume "smb://servicedesk/M"

do shell script "ln -sf /Volumes/M/ ~/Desktop/M"

end try

end tell

----------End script--------

When run the script on Mountain Lion 10.8.5 iMac, I can list the "M" when run the command in terminal: ls /Volumes/

But when run the script on Yosemite iMac, It's show "servicedesk" instead "M" when run the command in terminal: ls /Volumes/

I don't know why it is difference and can't do anything to create symlink to the Desktop now. Please help????

Thank you,

iMac, OS X Yosemite (10.10.1)

Posted on Jan 19, 2015 7:43 PM

Reply
7 replies

Jan 27, 2015 8:51 PM in response to StoneLucky

I can't speak for the different mount result, but (at least on 10.10.x) mount volume returns a file specifier of the mounted volume - in other words, it tells your script exactly where the volume was mounted. I don't have an older system available right not to see if that was always the case, but given that fact you could use that as the parameter to your ln command:


try

set mountedVol to mount volume "smb://servicedesk/M"

do shell script "ln -sf " & POSIX path of mountedVol & " ~/Desktop/M"

end try

(note that nothing in this script needs to be in Finder tell block)

Jan 28, 2015 7:14 AM in response to Camelot

Thanks for your reply @Camelot

Your reply is solved my question.

But I'm still wondering why it is same the way of script done (in OS 10.10.1) with 2 targets: shared folder on iMac and shared folder on Windows. The script which "mount volume" on MAC is have expected result, Windows is not. Please see the picture to easier understand

1/ "Idrive", is mapped from iMAC, "M" is mapped from WIndows

User uploaded file

2/ But when show the result in Terminal, "Idrive" can list, "M" doesn't but it's shown "servicedesk". The icon is also difference on the Desktop!!!

User uploaded file


much appreciate your comments

Jan 28, 2015 10:46 AM in response to StoneLucky

I can't be absolutely sure since I don't have (and am not inclined to install) a Windows system to test this, but there are two differences between your scripts that might be contributing factors:


In the first case, where you're mounting from the Mac server you are mounting/linking to a folder within the mount.


do shell script "ln -sf /Volumes/Idrive/public_MUSIC ~/Desktop/iDrive"


In contrast, on the Windows server, you are linking to the mount point itself.


do shell script "ln -sf /Volumes/M ~/Desktop/M"


There might be a difference if you link to a subfolder on the Windows mount, or to the Mac sharepoint

Yosemite run "mount volumes" is not same as Mountain Lion

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.