Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

migrated from Oct 1 '12 at 3:07

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

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.

share|improve this answer

You must log in to answer this question.

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