I's trying to write an AppleScript to disconnect and connect again to specific server:

    tell application "Finder"
        mount volume "smb://serveraddress/sharename" as user name "username" with password "password"
    end tell

But it is connecting only. I'm trying to do both: to disconnect and then to connect again.

  • 1
    Can you add the code you are using for the disconnect part as well?
    – nohillside
    Dec 1, 2015 at 15:39

1 Answer 1


I finaly figered out how to do that so i write this code and it works

tell application "Finder"
        eject alias "Volume name"
    end try
    mount volume "afp://Server/volume"
        open alias "Volume name"
end tell

I hope it will be helpful.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .