Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Oct 1 '12 at 3:07

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

1 Answer 1

up vote 0 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:

#!/bin/bash
mount -t smbfs //username:pass@addr /Users/me/RemoteDisks/mnt1
...etc

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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