|
|
#1 |
|
AppleScript: mount volume - help
In trying to figure out a way to have network volumes auto-mount at startup without ending up with a desktop full of finder windows I came across an Applescipt. I made some changes (addition of a few delays and '2nd attempts' as it did not work consistently,) and all seems to work ok.
Now the problem is, when I connect to the machine over the network (afp) neither the root volume nor any of the network shares show up. Firewire drives still show up fine, however. I have determined it to be somehow releated to the script but I can't see how... Any ideas? Can anyone suggest a better way to auto-mount at startup (short of using NetInfo on OSX server)? Here's the code: Code:
tell application "Finder"
delay 0.3
try
mount volume "afp://sumdumuser:sameolpw@MAC-SERVER.local/FTP"
on error
delay 1
try
mount volume "afp://sumdumuser:sameolpw@MAC-SERVER.local/FTP"
on error
display dialog "There was an error mounting the Volume." & return & return & ¬
"The server may be unavailable at this time." & return & return & ¬
"Please inform the Network Administrator if the problem continues." buttons {"Okay"} default button 1
end try
end try
delay 0.3
try
mount volume "afp://sumdumuser:sameolpw@MAC-SERVER.local/AnotherVolume"
on error
delay 1
try
mount volume "afp://sumdumuser:sameolpw@MAC-SERVER.local/AnotherVolume"
display dialog "There was an error mounting the Volume." & return & return & ¬
"The server may be unavailable at this time." & return & return & ¬
"Please inform the Network Administrator if the problem continues." buttons {"Okay"} default button 1
end try
end try
end tell
__________________
†Actual post may vary from original thought. |
|
|
|
0
|
|
|
#2 |
|
Script looks fine. You sure you haven't unchecked the Connected Servers in your Finder preferences?
You can also browse to /Volumes to see if the drive actually was mounted. While I use the Applescript route as well, this guy took a different approach. http://julipedia.blogspot.com/2007/0...s-startup.html
__________________
|
|
|
|
0
|
|
|
#3 |
|
Thanks for the link. I had tried to find a way to do it with a shell script using the 'mount' command, but the syntax was a bit intimidating. I'll keep working towards that angle...
Also, just to clarify, when I connect to another mac I am not even given a choice to mount the system drive (i.e. no volumes show up in the list of volumes to mount, nor does the home folder.) If any firewire drives are connected, however, they will show up.
__________________
†Actual post may vary from original thought. |
|
|
|
0
|
|
|
#4 |
|
|
0
|
|
|
#5 |
|
Hope this helps...
I have been searching FOREVER to find a script that would:
1: Mount a network drive (which might still be booting when the computer is turned on) 2: Not give annoying messages. If others out there on the interwebs are searching for such an applescript, here is what I came up with. So far, it seems to be working. You'll need to change the ip address of the shared drive and the user/pass, as well as customize anything you want (how long before it retries, etc). It basically: 1: Tests to see if a mount point exists. If not, it creates one. 2: Runs every 30 seconds up to 9 times (~5 mins) and tries to mount the network drive. 3: After 9 tries, it exits. ** I am not a programmer, so this syntax may not be "clean", but it works. ** Code:
global x set x to 0 set mounted to do shell script "test -d /Volumes/share && echo yes || echo no" if mounted = "no" then do shell script "mkdir /Volumes/share" else do shell script "echo 'mounted'" end if repeat until x > 8 or (list disks) contains "share" tell application "Finder" try do shell script "mount_afp -dv afp://[user]:[password]@192.168.1.1/share /Volumes/share" on error set x to x + 1 delay 30 end try end tell end repeat Last edited by OllyW; Nov 2, 2012 at 02:24 AM. Reason: Please use code tags |
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| I figuratively punched a hole through my Mac - Help! | motulist | Mac Basics and Help | 4 | Nov 30, 2011 12:58 AM |
| Bootcamp, 2 Volumes and Fusion Issue | Darksheer | Windows, Linux & Others on the Mac | 4 | Jul 1, 2011 12:04 AM |
| Bootcamp, 2 Volumes and Fusion Issue | Darksheer | Mac Applications and Mac App Store | 0 | Jun 30, 2011 06:09 PM |
| hot to mount disk using volume UUID? (and unmount) | Ancandis | OS X | 1 | Nov 17, 2010 11:44 PM |
| AppleScript: checking for mounted volume | yellow | Mac Programming | 15 | Sep 30, 2006 03:24 PM |
All times are GMT -5. The time now is 03:18 PM.






Linear Mode

