Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Unmount a volume (on login) via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Unmount a volume (on login) via AppleScript
Authored by: regulus on Feb 24, '06 12:08:13AM

I used to use an alias to accomplish this, but I found that the alias would stop working after a time. I couldn't figure out why the alias would stop working but it happened a lot. So I finally wrote this applescript and saved it as an application as run only... it works every time. Then just add it to your login items and you're all set.

tell application "Finder"
if not (exists disk "VolumeName") then open location "afp://username:password@ip_address/VolumeName"
end tell

Note: the if not statement first checks if the volume is already mounted, because if it is then you'll get a dialog box telling you that it's already mounted and thus you have to click "OK" to get rid of the dialog box... which is a pain.

Hope this helps.

[ Reply to This | # ]