Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chris1111/c44046e7a4aef9905fc1e697b46a7fd2 to your computer and use it in GitHub Desktop.
Save chris1111/c44046e7a4aef9905fc1e697b46a7fd2 to your computer and use it in GitHub Desktop.
# Eject Disk image or External Disk Applescript
# Applescript from chris1111 2020.
# (I think is the only Applescript that does not crash if the disk that has to unmount does not exist)
# Change the name MYDISK to the name you want
tell application "Finder"
activate
if exists disk "MYDISK" then
tell application "Finder" to eject disk "MYDISK"
end if
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment