I am coming from Linux and trying to get a Mac to do what I want it to do. The question is what is the best tool to use. I want to mount (unmount) several remote disks. If I go into a terminal I can do the trick by

mount -t smbfs //username:pass@addr /Users/me/RemoteDisks/mnt1

Since I want to mount several disks I would like to put all of the information into a file, store it in Documents/subfolder and make a link to it on the desktop (or somewhere better, if there is a better place). At the moment I have manually run the appropriate command in the terminal and the remote disk is mounted and I see its contents. What I need is a one click method to run a file to mount all the disks.

I tried Apple script but that didn't like my commands. I don't know exactly what it is expecting to see and perhaps Apple script is the wrong tool. I have no problems in Linux, but the Mac is new to me and I don't know what I should be using.

Thanks, Ilan


AppleScript is a completely different language, with different commands, syntax, and capabilities; for what you are trying to do, a shell script is the way to go. First, make your file a proper shell script by starting it with a shebang line:

mount -t smbfs //username:pass@addr /Users/me/RemoteDisks/mnt1

Then, make it executable with chmod +x /path/to/script. Finally, if you want it to be double-ckickable in the finder, add the extension ".command" to its filename so the Finder will know what to do when you double-click.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.