questions about mounting a drive

i use the following script to mount the drive from my imac .

on idle

–mount the iMac drive if it is turned on
try
tell application “Finder”
mount volume “MacHD” on server ¬
“IMAC” as user name “UserName” with password “Password”
end tell
end try

--make sure it is mounted every minute
return 60

end idle

i am trying to do the following with this script:

  1. i tried to put a loop in there first to see if it was mounted with a list disks but even when mounted on my desktop it is not showing up in the list. any ideas why this might be happening?

  2. once mounted i would like to move it to the dock with my other drives, internal on the computer i am using. is this even possible? tried searching here and google and other places, no luck.

2a) if it can be moved to the dock cahow can it safely be removed from my desktop?

looking forward to any advice…

  1. What do you get when you ‘tell application “Finder” to list disks’?
    Do you get ANY disks listed? your internal/startup disk? or is it just the network volumes that aren’t listing?

  2. There’s no way (AFIAK) to programmatically add a disk icon to the dock, but you can easily do it manually - drag the icon of the disk on the desktop to your dock. Even when not mounted the disk icon will stay in the dock, and a click on the dock icon will immediately mount the volume for you.

  3. Under Mac OS X, there’s an ‘all or nothing’ approach to showing network volumes on the desktop. In the Finder preferences there are options for what volumes to show on the desktop. Options include ‘hard disks’, ‘removable media’ and ‘connected servers’. Sinply uncheck the ‘connected servers’ item and all the server icons will disappear off the desktop.

thank you for answering so quickly.

  1. when i tell app “finder” to list disks i get only the locally connected drives and partitions on my computer.

  2. i tried this. if my drive becomes unmounted the icon stays in the dock but has a “?” mark over it. when i click this nothing happens.

  3. this is what i have done to my local volumes and did not notice the check for the connected servers. guess i should open my eyes a little more when i read.