Eject flash drive

Eject flash drive

Postby Layo » Sun Jul 08, 2012 3:14 am

Can I assign a keyboard shortcut to eject a flash drive (without having to go into Finder)?
Posts: 11
Joined: Mon Mar 05, 2012 2:44 am

Re: Eject flash drive

Postby gb2 » Mon Jul 09, 2012 10:31 am

you could by using an AppleScript step set to the following code and putting the flash drive name into the variable driveToEject as indicated:

Code: Select all
tell application "Finder"
   -- change the text between the quotes to the drive name you want to eject
   set driveToEject to "EOS_DIGITAL"
   set allVolumes to the name of every disk
   repeat with i from 1 to the count of allVolumes
      if item i of allVolumes is equal to driveToEject then
         eject (item i of allVolumes)
      end if
   end repeat
end tell
User avatar
Site Admin
Posts: 2875
Joined: Mon Feb 06, 2006 6:22 pm

Return to QKM General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests