How to set up key ⏏ (or any other) for extracting flash drives and external hard drives
Tips Makradar / / December 19, 2019
Recently I finally got around to issue in the USB-pocket, pulled out of my MBP 13 ", 500 GB hard drive, remaining after the upgrade. At this step I pushed the lack of space on the SSD, which will sooner or later affect all users drive less than 512 GB (I have only 120 GB). Leaving aside the inconvenience of extra cables and pulling another box (with no burden at home on a table) I ran into a problem that I was very annoyed - the need for removing the disc before disconnecting it. The mind, it should be done and with flash, but I do not always stick to this rule, but with the "hard" has decided not to risk it - honestly go to the Finder and removed. Within two weeks of infrequent use my USB-disks, to me it is rather tired and I started thinking about what a neat solution. In one of those moments, my eyes fell on the key ⏏, conveniently located at the corner of the keyboard and my mind began to mature grand plan ...
Yes, I decided to find a way to involve key ⏏ for these purposes. The plan was simple enough, and that's how I imagine it represented:
- write a simple script that retrieves all the drives;
- create a service for him Automator;
- hang service on any shortcut;
- redirecting key ⏏ the selected shortcut;
- profit!
I will not go into the details of my research, because the most important result, which I still hit, so just move on to the step by step instructions on how to implement it all.
we need
- Key ⏏ (if you have a modern Mac without this key, you can use any key or combination of keys);
- utility KeyRemap4Macbook;
- Automator (supplied OS X);
- I've found Eject_all_MacRadar.workflow (If you do not want to busy themselves in Automator'e);
- straight arms and 10-15 minutes of free time;
Step 1. create service
1. Open Automator and select Document Type - Service.
2. At the top of the window to The service receives: indicate - there is no data and in any program.
3. In the sidebar on the left to select a category UtilitiesWe find in it an element Start the Apple Script and drag its main area of the window.
- We put in the script code instead (* Your script goes here *) Now this line:
tell application "Finder" to eject every disk
5. Here (in the category Utilities) Find an element Show notification and drag it by making the second in the chain of our actions.
- Trying to drive in the text field header, Message and make out the notification banner as you like more, my version you see on the screenshot.
It remains to verify the work of our service before you save it. Click the appropriate button in the upper right corner and seeing three green check marks in journal (If done correctly).
7.1. If you are too lazy to create a service, you can use a file ready, just download it this link and open system, Automator will offer to install a service, along with it, and everything is ready.
Step 2. We assign a hotkey to our service
- Run the System Preferences and go to the section Keyboard.
2. Go to the tab Combinationkeys and switch over in the sidebar on the item services.
- We find in the section main our service, we put a tick next to it and set the desired shortcut.
Everything. From that moment on, pressing the specified hotkey will retrieve all your disks, no matter whether it is USB-flash drive, ROM or mount the image. If your goal is not binding the service to key ⏏ (or any other) - this can be stopped. If you still want to make a true-Discs zabindit and for this purpose a specially crafted Johnny Ayvom button - go ahead.
Important! If you want to use to extract key ⏏ - need to ask for our service shortcut ⌃⌥⇧⌘E (Ctrl + Option + Shift + Command + E). Such combination contraption necessary for KeyRemap4Macbook.
Step 3. Set KeyRemap4Macbook or reassign key
- Download the utility of this link and install it.
2. Open KeyRemap4Macbook via an icon in the menu bar or Launchpad and go to the tab Change key.
3. Here we need to select a key. According to our idea, we select Change Eject key and put a tick against the item EjecttoCommand + Control + Option + Shift + E.
- Everything. You can close the window with KeyRemap4Macbook settings.
Finally, we'll have reached the goal - a keystroke on the keyboard ⏏ extracts all the wheels, and the notification is displayed, signaling that the drive can be safely turned off. It's great, right?
notes
- I must warn you that the keys ⏏ has a feature - it works with a small delay. Therefore, it is necessary to press her usual touch - a quick tap, similar to the way we print text, it may not work. But it did not interfere, and you may not even pay attention to it.
- retrieval service tied to key ⏏, works in any application, and is also available via a standard menu of services.
- If you are the owner of the Mac that does not have the key ⏏, but often work with removable USB-disks and You want to use this service - you can choose to KeyRemap4Macbook another key or use a regular shortcut.
Here is such a simple, but very useful life hacking. I have fulfilled its task and happy to use such a solution. I think it will be useful to you, dear readers.
We have questions, comments or suggestions? Welcome to the comments - I'm always happy to talk and help. Stay tuned, there is still a lot of interesting things!