Advertisement
Guest User

Untitled

a guest
Jul 15th, 2009
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. property user_name : ""
  2. user_name = "" # Added in because sometimes the script would magically remember the values of its last run despite being terminated?
  3. if user_name is "" then
  4.     set dialog_1 to display dialog "Please enter your username so I can dismount the corresponding volume" default answer ""
  5.     set the user_name to the text returned of dialog_1
  6. end if
  7.  
  8.  
  9. tell application "Finder"
  10.     try
  11.         set remoteDisk to disk user_name
  12.         eject user_name
  13.     on error
  14.         display dialog "Oh dear, I couldn't find a volume of that name (" & user_name & ") to unmount!" & return & return & "Have you had enough vitamin c today?" buttons {"No"} default button 1
  15.     end try
  16. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement