Last active
January 11, 2021 16:29
-
-
Save fgardavaud/c60a7c8f78303514226094cca8d1a01d to your computer and use it in GitHub Desktop.
script to disconnect network drive in apple script langage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------------------------------------------------------------------ | |
-- 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