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: doneitner on Feb 23, '06 05:57:27PM

Man, I'm still trying to find a good way to mount a (network shared) volume on login, and you're talking abount UNmounting one. :) I suppose this could be good, though, for ejecting a CD/DVD before any kind of auto-run occurs.



[ Reply to This | # ]
Unmount a volume (on login) via AppleScript
Authored by: sloth on Feb 23, '06 09:39:56PM

Create an alias to the volume and then add it to the login items for the user. It will mount the volume upon login.



[ Reply to This | # ]
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 | # ]