unmounting volumes

I am trying to write a script that will perform the following tasks:

  1. When file(s) are dropped on the script icon a volume from another computer on the network is mounted on the desktop;
  2. The file(s) are copied to that volume.
  3. The volume is unmounted, i.e is dragged to the trashI have succesfully written a script that completes the first two tasks, but can’t seem to get the third task completed.
    Any help is appreciated.