Skip to content

Instantly share code, notes, and snippets.

@robballou
Last active December 1, 2016 16:05
Show Gist options
  • Save robballou/adcab7a454599f1935eb381155e1805e to your computer and use it in GitHub Desktop.
Save robballou/adcab7a454599f1935eb381155e1805e to your computer and use it in GitHub Desktop.
AppleScript to shutdown iTunes and eject an external drive. Change the volumename "Example" to the volume you want to eject. You can run this in Alfred if you want to be extra cool
# Stops iTunes and ejects an external drive
set appname to "iTunes"
set volumename to "Example"
tell application appname to quit
repeat until application appname is not running
delay 1
end repeat
tell application "Finder" to eject volumename
display notification "Ejected Volume" with title "Eject"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment