Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@fgardavaud
Last active January 11, 2021 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fgardavaud/c60a7c8f78303514226094cca8d1a01d to your computer and use it in GitHub Desktop.
Save fgardavaud/c60a7c8f78303514226094cca8d1a01d to your computer and use it in GitHub Desktop.
script to disconnect network drive in apple script langage
------------------------------------------------------------------------------------
-- Script name : Deco_Reso_v2.app
-- Aim : Disconnect network drive with macOS system.
-- No configuration is required by the user except to give the right of program execution if SIP is active on your computer
-- try is to avoid finder infinite loop if you can't acces to the network drive for various reasons.
-- to find your network drive name just put the name under your "people sharing icon" in your desktop screen
-- Author : Francois Gardavaud, MPE. Medical Physicist Expert.
-- Date : 07/09/2020
-- Version number : 1.0
-- OS : macOS
-------------------------------------------------------------------------------------
tell application "System Events"
try
do shell script "diskutil unmount /Volumes/your_network_drive_name"
end try
delay 2
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment