Q: Display a dialog box after ejecting a USB drive saying drive has been ejected
Hi, would someone please tell me how to modify the applescript below to eject my USB in 2 ways, either by waiting 30 secs or by pressing the "YES" button. Then, after the drive has been ejected another dialog box would appear saying "Drive Ejected". If the "NO" button was pressed the drive would not be ejected. My USB drive is shown as ( thisVolume ). Thanks in advance for any help.
tell application "Finder"
display dialog "Eject USB Drive?" buttons {"Yes", "No"} default button 1 with title "Eject?" giving up after 30
if button returned of result is "yes" then eject thisVolume
end tell
Mac mini, OS X Mavericks (10.9.5)
Posted on Jul 21, 2016 9:01 PM
Here:
tell application "Finder"
display dialog "Eject USB Drive?" buttons {"Yes", "No"} default button 1 with title "Eject?" giving up after 3
if button returned of result is "yes" or gave up of result then
eject thisVolume
display dialog "Drive ejected."
end if
end tell
(143586)
Posted on Jul 21, 2016 9:17 PM