How to Add a Delete Option to the Context Menu in Mac

http://videohive.net/?ref=gimmegfx



automator-delete-option-thumbIf you are a Mac user, you will be aware that it doesn’t lets you permanently delete files through the context menu. There is only an option “Move to Trash” that move your file for the trash and you've got to manually empty the trash to delete the file. Wouldn’t you choose great if you possibly could add a “Delete” option in the context menu in order to quickly and easily delete the file/folder?

In terminal, we can easily easily delete (or remove) a file or folder while using command “rm“. Coupled with all the “-rf” flag, we can get the system to forcefully delete personal files or folder without prompt. In this tutorial, I will explain to you how you can make use of this command, in addition to Automator, to put in a “Delete” option towards the context menu.

1. Open Automator and select “Services”.

automator-select-services

2. At the top of the correct pane, select “files or folders” in “Finder”.

automator-select-files-in-finder

3. On the left most pane, select “Utilities” and drag the “Ask for Confirmation” option towards the workflow. Enter the message to exhibit up within the confirmation dialog.

automator-confirmation-message

4. Next, drag “Run Shell Script” for the workflow. Change the “Pass input” field to “as arguments”.

automator-run-shell-script

Paste the next lines in to the shell script body:

for f in "$@" do rm -rf "$f" done   afplay "/System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/finder/empty trash.aif"

5. Lastly, save the service using the name “Delete”.

automator-delete-option

That’s it. Now when you right visit any file or folder, you ought to see a “Delete” option. Select it and it will delete the file/folder.


Binding a shortcut step to Delete file


An additional thing you can do with this newly created “Delete” service is to bind a keyboard shortcut with it. You can then press the shortcut answer to quickly delete the file.

1. In Finder, head to “Finder -> Services -> Services Preferences” in the menu bar. Locate the “Delete” option, select it and select “Add shortcut”.

services-add-delete-shortcut-key

2. Once you have set your shortcut key, you can press it once you've selected the file(s) and this will delete the selected file(s).

Enjoy!

Title Post: How to Add a Delete Option to the Context Menu in Mac
Rating: 100% based on 99998 ratings. 5 user reviews.
Author: SharedTutor

Thank you for visiting sharedtutor.com, If there is criticism and suggestions please leave a comment


thumbnail
About The Author

Someone who always wanted to know about the beauty of the world :)

0 comments