Do you have a command or a set of tasks you execute regularly or repeatedly on your Mac? Want to keep them handy and execute them on the fly? In this post we’ll show you know. It’s all done within your Mac without the use of third-party applications or hacks. As a bonus, we’ll show you how to add a shortcut key, and how to delete everything you created.
The Mac operating system is known commonly known for it’s effciency in getting things done. But you can always kick productivity up a notch. We figured it would be great if commands or repetitive tasks we regularly do can be compiled (or packaged up) and excecuted within a command, or in the right-click menu.
To give you an idea of the long repetitive tasks we’d like to avoid, imagine this scenario where you have to convert folders upon folders of image files from PNG to JPG. Rather than booting up Photoshop or using a third-party app to do the job, why not just set it up in the right-click menu and run it with just a click?
Here’s how you do it. First we design the commands and the execution process with Automator. Then, we’ll put this into the right click menu for easy access and for fast execution. Here are two walkthroughs to get you started and to give you an idea of how this works.
Recommended Reading: 6 Simple & Effective Ways To Speed Up Your Mac
Customize Contextual Menus with Automator
To give a clearer look at how powerful this customization is, we’re going to illustrate this with two examples. The first is to replace spaces with hyphens and secondly, we’ll show you how to setup a single click for png-to-jpg image conversion.
Example 1: Replace spaces in a filename with hyphens
- Start Automator from your Applications folder or Launchpad.
- Choose Service for your document.
- At the right-hand panel, select "files or folders" in "Service receives selected".
- Then, at the left-hand panel, select Files & Folders > Rename Finder Items.
- In the "Add Date or Time" panel, select Replace Text.
- Replace all spaces with hyphens by putting in a space In "Find" and a hyphen In "Replace".
- Finally, go to File > Save. Insert a filename (e.g. Replace SPACE with -) and this will be the name used in the contextual menus too.
That’s it! This service document will be saved in your Home > Library > Services folder and be ready for use.
Example 2: Convert PNG/TIFF/BMP Images to JPG Images
- Repeat Step 1 to 2 as above.
- At the right-hand panel, instead of text, this time we select "image files" in "Service receives selected".
- Then, at the left-hand panel, select Photos > Change Type of Images. Automator will prompt you to add a Copy Finder action, click Add. This is to ensure your original PNG images will remain and won’t be replaced by JPG images.
- Select a destination for your output files in "Copy Finder Items" panel. Choose JPEG in "Change Type of Images" panel.
- After that, go to File > Save. Insert a filename (e.g. Save as JPG) and this filename will be used in your contextual menus.
Now, select any non-JPG image, right click and select the this service in contextual menus. And you will see all your selected images converted to .jpg extension.
Bonus: Run it with a shortcut Key
We can run customized commands faster by assigning keyboard shortcuts with special commands to execute it on the fly. In fact, we’re going to show you how to run the customized commands that we’ve just created, using keys instead of right clicks.
- Go to System Preferences > Keyboard.
- On the left-hand panel, select Services. Then look for the customized command which we created earlier where we replaced empty spaces with hyphens. Click on the "add shortcut" button to add your preferred keyboard shortcut keys.
- Now, you can run a customized command by using keyboard shortcut keys you’ve set.
Bonus: how to remove contextual menu items
If for one reason or another, you want to remove items from the contextual menu you can 1. deactivate it or 2. remove the workflow file.
- To deactivate the command but still keep it in your Mac, go to System Preferences > Keyboard > Keyboard Shortcuts > Services. Uncheck the items you don’t want shown in the contextual menu.
- To remove the workflow file, in "Finder", choose Go > Go To Folder. Then, go to the folder ~/Library/Services. Here, you can remove the workflow file so it will be deleted and it won’t appear in contextual menu anymore.
Designing an automation workflow doesn’t need any programming background. Mac’s Automator has made it extremely simple: just drag & drop actions from the selections, and save it as a workflow item in the right-click menu. Now you can fully utilize this trick to increase your productivity.