mount volume - nobrowse


Is there any way to use “mount volume afp://…” with the nobrowse option, or do I need to use the mount_afp shell script?

what is the “no browse” option?

try this

set theDisk to "external_disk_name"
set ipaddress to ""
set username to "your_user_name"
set psswrd to "your_password" -- if you leave blank ("") then you will be prompted for a password

mount volume ("afp://" & username & ":" & psswrd & "@" & ipaddress & "/" & theDisk)

From the mount_afp man page

Indicate to the Carbon subsystem that this volume is not
to be displayed to the user.

The regular mount man page though says this
Any additional options specific to a filesystem type that is not
one of the internally known types (see the -t option) may be
passed as a comma separated list; these options are distinguished
by a leading ``-‘’ (dash). Options that take a value are speci-specified
fied using the syntax -option=value. For example, the mount com-command:

               mount -t hfs -o nosuid,-w,-m=755 /dev/disk2s9 /tmp

         causes mount to execute the equivalent of:

               /sbin/mount_hfs -o nosuid -w -m 755 /dev/disk2s9 /tmp[/i]

So that said perhaps one of these would work?

mount -o -nobrowse
mount -o ,-nobrowse

Not sure though

Well I’m not exactly sure what opus_az is trying to accomplish, but here’s an idea. You can make the mounted hard drive invisible in the Finder (just like you can make a file or folder invisible) so the user can’t see it. For this to work you need the developer tools installed because it uses 2 unix executable files that only get installed with the developer tools. Basically when you mount a drive it gets mounted in /Volumes directory. With the GetFileInfo and the SetFile unix executables, you can view and change attributes of it.

For example, if you mounted a volume called “opus” you can get the attributes of opus from the Terminal with…
/Developer/Tools/GetFileInfo /Volumes/opus

Under the “attributes” section you’ll see a letter “v”. If the “v” is a lower case v then opus is visible. If the “v” is an upper case V then opus is invisible. Look at the man page for more information. So the way to make opus invisible is with this Terminal command…
/Developer/Tools/SetFile -a V /Volumes/opus

That sets the v to an upper case V thus it is invisible. The -a means set the “attributes”. Once you change this setting you have to relaunch the Finder for it to take effect. For that you can use this from the Terminal…
killall Finder

Note: to set opus back to visible again use these in the Terminal…
/Developer/Tools/SetFile -a v /Volumes/opus
killall Finder

Now that you know the Terminal commands, you can use them in applescript with the “do shell script” command. Put it all together with your mount volume command and you have a solution. I wrote some code for changing the visibility of things. Look at my second post here:

Gotta love Dev Tools =)

Tomorrow at work Im going to try to use the no browse option and see how that interacts… it would be interesting to see if you could still browse those volumes through go to folder like you can if you setfile a volume.

Hi, all. Thanks for the replies.

Here’s the gory details… I’m opening applescripts that are saved on a shared directory (“Netlogon”) on a Windows server. To get to these scripts I first have to mount a volume to that “Netlogon” share and I’d rather not have that mount visible to users during the process, thus the nobrowse.

Right now I’m using “do shell script “mkdir /Volumes/Netlogon”” and then a "do shell script “mount_afp “afp://… -o nobrowse”” but I’d prefer to do that with applescript’s “mount volume” since that way I don’t have to worry about the /Volumes/Netlogon being orphaned if the mount fails.

I put in some added logic to recover from a failed mount, but since the “mount volume” does all that for me I’d prefer that way.

Long story short, I can get along with using mount_afp in a shell script…" so it’s not a big deal. And, keep in mind I’m a novice to Macs and applescript so maybe I’m trying too hard, I wouldn’t put that past me. lol.

Thanks all. Appreciate it.