Below I have a script that I use all the time. It seemed to be working flawlessly before updating to OS 10.4.2 but I’m not 100% positive of that. Anyway when I use this script and choose the volume to mount it will sometimes error with the message:
“Finder got an error: Disk some object wasn’t found.”
and the volume will not mount. Other times I’ll get the same error but the volume will mount. Any ideas?
Thank you all.
set diskList to list disks
set mountedVols to {} as list
set volList to {"OWC Neptune", "Macintosh HD G51", "admin1", "CromaPro"}
set cnt to count diskList
display dialog "Do you wish to mount or dismount volumes?" buttons {"Mount", "Dismount"} default button "Mount"
set butChoice to button returned of the result as text
if butChoice is "Mount" then
if cnt is not 6 then
repeat with i from 1 to 4
if diskList does not contain item i of volList then
set mountedVols to mountedVols & item i of volList
end if
end repeat
tell application "Finder"
choose from list mountedVols with prompt "Choose volume/s to mount."
set choice to result as text
if choice is "OWC Neptune" then
mount volume "afp://199.155.155.155/OWC Neptune" as user name "dadada" with password "dadedada"
else if choice is "Macintosh HD G51" then
mount volume "afp://199.155.155.155/Macintosh HD G51" as user name "dadada" with password "dadedada"
else if choice is "admin1" then
mount volume "afp://199.155.155.155/admin1" as user name "dadada" with password "dadedada"
else if choice is "CromaPro" then
mount volume "afp://199.155.155.155/CromaPro" as user name "doda" with password "dodade"
end if
end tell
else
display dialog "All volumes are currently mounted."
end if
else
my dismountVol()
end if
on dismountVol()
tell application "Finder"
eject every disk
end tell
end dismountVol
Model: G5 dual 1.8
AppleScript: 2.1
Browser: Safari 125.12
Operating System: Mac OS X (10.4)
I believe that it was running alright before the upgrade from 10.3.9 to 10.4 and then 10.4.2. Don’t have a 10.3 machine around. As far as the error is concerned the only message is that above and it will highlight any of the four lines for whichever volume is trying to mount.
I found out that including username and password in the mount command works for me with 10.4 I didn’t try it on multiple sharepoints of a machine, but it should work. It’s possible to issue the command even in safari or in connect to server (apple-k)
mount volume "afp://username:password@199.155.155.155"
Model: Cube 450
Browser: Safari 412.2
Operating System: Mac OS X (10.4)
Thanks for the reply. It did not work quite right the way you have it. It would come up with the dialog asking me to choose which volume to mount, but while playing around with what you wrote I came up with this and this seems to work well for me.
mount volume "afp://199.155.155.155/Macintosh HD G51/username/password"
Thank you.
PreTech
Model: G5 dual 1.8
AppleScript: 2.1
Browser: Safari 125.12
Operating System: Mac OS X (10.4)
Well, seems that eventhough I tried the above code several times with one of the volumes, and it mounted flawlessly, as soon as I edited my original script for the new code it decided that it has to put up the dialog box asking for the user name and password. AAARRGGGG! :mad:
Maybe it’s something with my computer. There are some things that are not working quite as they should and I’m contemplating wiping the hard drive and reinstalling everything. I’ll keep trying.
Ok. It seems that because I had another drive that is essentially part of the same volume (same pass and user, different drive) already mounted that the script
mount volume "afp://199.155.155.155/Macintosh HD G51/username/password"
worked because there was already a connection. So your script actually works but in order to avoid any dialog boxes I had to edit it like this.
mount volume "afp://user:password1@192.168.0.51/hardDriveToMount"