Keyboard Maestro Blog Posts
Reset Clipboard History in Keyboard Maestro
Keyboard Maestro gives users a couple of options when adding a macro - the content can be typed or pasted in. If there???s a lot of text to be inserted, pasting is the right way to go. Not only does the content get added faster, but there???s less chance of accidentally typing a key when the macro is being inserted.
The downside to pasting is that the pasted content is now the most recent data in the clipboard. (Which isn't good if you want to do multiple things with the clipboard content.)
Adding Clipboard History
After I paste a content, I add the "Set System Clipboard to Past" to ignore the content being pasted in the clipboard:
The advantage of doing this is that I can still use the clipboard content in another Macro or have access to the original content.
In the above example, I am pasting in a random phrase that I have setup for testing. The clipboard get's reset after the content gets pasted.
Hide Multiple Browsers Bookmarks
Sometimes I like to showcase how a website looks in Chrome and Firefox. I usually hide the Bookmark bar so that it's less distraction to the screenshot.
I made this process easier by creating a Keyboard Maestro macro to hide both browser's bookmark toolbars at the same time.
Using Keyboard Maestro, I set up a Macro so that I could close both Chrome and Firefox Bookmarks at the same time.
Keyboard Maestro Macro
Some Notes on the Macro
I used a weird keyboard combination to open/close the bookmark bar. If I need to do this a lot, I'll change up the shortcut to something a bit more reasonable.
When I execute the command a second time, both bookmark toolbars are visible.
I can easily change this to support other browsers, such as Omni, Safari and Maxthon.
The commands execute almost simultaneously and it doesn't matter which browser I have currently focused.
Adding Excel Date Shortcut Everywhere
If your a regular user of Excel you probably know the shortcut to add the current date to any field: Control ;
So, if your use to it, why not just make it a shortcut in any application.
Here's is a simple way to add Excel 'Today's Date' feature using Keyboard Maestro.
Now when I need to add the date, I simply type in Control ;.
What if you need a different date format in different applications? For example, you may want to display today's date differently in Slack than in an Excel table.
There's a simple way to make this happen (This is what makes Keyboard Maestro a really cool application!) Simply put in a condition to check to see what is the current active application:
I used PHP to do the formatting here because I wanted to add an English ordinal suffix (1st, 3rd)
I can add multiple applications checks by adding additional conditions to the statement. Which makes it easy to have a single action short cut to display different formats in applications.
Keyboard Maestro Keyboard Shortcut Enhancer
If your switching back and forth between applications, it can be hard to remember certain keyboard shortcuts. Apple has a UI Guidelines which standardize many common tasks: Cut/Paste/ Hide Applications.
What's nice about Keyboard Maestro is you can define short cuts when the application don't have functionality to do so.
Case in Point: I navigate between Apple Mail and Microsoft Outlook a lot. I wanted to have one keyboard shortcut to insert HTML links - since it's a command that I use a lot. Outlook uses Control Command K and Apple uses Command K.
With Keyboard Maestro, I can now remember only one shortcut between applications:
The above macro is in a group that is available only for Microsoft Outlook. This way it doesn't get activated in other applications. Come to think of it, it might be a good shortcut for BBEdit insert Anchor action.
Keyboard Maestro and LaunchBar Clipboard Management
Keyboard Maestro and LaunchBar have excellent activate clipboard history switcher. Having both of them enable allows you to get the best of both worlds when you need it.
Keyboard Maestro Advantage
- You can keep the Clipboard History Switcher and mouse click what you need.
- You can "pin" clipboard items so you won't loose them.
- You can preview more of the images in the dialog box.
- Simple Interface, simply select the text and the dialog goes away.
- Perfect for the quick clipboard history use.
- ClipMerge - Press Command-C twice to merge the copied data with the latest clipboard content. Useful for list building.
Trick to have them Both Enabled
One trick to having multiple Clipboard management is to have a similar hotkey. This is the setup that I have for both:
- Launch Bar: Command ∖
- Keyboard Maestro: Shift Command ∖
Settings in LaunchBar and in Keyboard Maestro.
This makes it easy to switch between the two functionalities and use the one that is perfect for me right now.
iTerm2 is a popular Terminal replacement for Apple???s Terminal application. It provides the ability to create profiles with unique text colors, window appearance and key mapping.
Here???s a simple Keyboard Maestro Macro to open a new Terminal Session from any application.
tell application "iTerm" set myString to "echo -ne "033]0;"Database Server"007"" set newWindow to (create window with profile "Postgres Server") tell current session of newWindow write text myString end tell end tell
Why Have This Macro?
This comes in handy when I want to open up iTerm2 and go to a specific site..I don't have to open up iTerm2 and then switch to the profile and then select the profile.
I have been working with Markdown a lot lately. Trying to convert markdown to HTML has been a bit tricky. One solution that I found was MultiMarkdown. It's a command-line package that allows you to quickly convert markdown to HTML.
After playing with the tool for a while, I figured it's worth making a Keyboard Maestro Macro out of it.
Download the Latest MultiMarkdown Utility
To download the latest version of MMD and core tools, visit the GitHub project releases page, there is a MacOS https://github.com/fletcher/MultiMarkdown-6/releases
You can find additional information on using MultiMarkdown on http://fletcherpenney.net page.
Sample Macro in Keyboard Maestro
Here's a sample of the Macro that I have created to integrate with MultiMarkdown. The goal of this Macro is to take the Markdown content of the clipboard and convert it to HTML format.
Note: I am still working on ways to make this Macro better, I thought, for now, I should share what I have to help others.
Trigger Macro by Name
Trigger Macro by Name is an easy way to access your Macros. This is useful when you don't want to assign a keyboard shortcut because the action isn't used all the time. It's also a good way to execute a macro when you can't remember the trigger command.
Creating the Trigger Action
Trigger Macro by Name isn't enabled by default, you have to create a Macro to get this working.
- Create a new Macro, put it in the default Global Macro Group
- Create a useful trigger action, Keyboard Maestro recommends: Control Option Command T
- Insert the Trigger Macro by Name Action
Now when you use the Control Option Command T you'll be able to access any active Macro in Keyboard Maestro.
Make the initial search as use:10m that way you'll have instant access to any macro when you trigger the command.
Recent Activity Smart Group
Every once in a while a Macro might accidentally get triggered. Wouldn't it be great to figure out which one got executed - so you can fix the trigger action?
There are several ways to find the most recent triggered action, but the simplistic way is to create a smart group which shows the most recent triggered action.
Creating a Smart Group
- With Keyboard Maestro open type in Option Command N
- In the Group section. you should see a new Smart Group created called "Untitled Smart Group"
- I suggest renaming it to "Recent Activity"
- Under the "Matches any of these search strings" put in "use:10m" (Or what ever duration you want) Tip: The shorter the duration, the fewer results will be shown.
For my smart group settings, I set the configuration to be within the last 10-minutes. I feel that gives me plenty of time to get to Keyboard Maestro and fix the issue.
Having a "Recent Activity" smart group is also useful if you need to edit a recently triggered action because it didn't do something right. As you don't need to search for it, you can be sure it will be in the "Recent" smart group.
Clipboard URL Tracking
Keyboard Maestro has the ability to perform certain actions based on an activity, such as when a USB card is inserted or when you connect to a network. It makes Keyboard Maestro a really powerful application.
Working with the Active Clipboard
One of the monitor activities is the ability to watch the clipboard. That got me thinking. What if there was a way to save the URL that I pasted in the clipboard? That way I can use it later whenever I like.
The goal would be watch changes pasted in the clipboard, and if there's a URL assign it to a variable.
This is the Macro that I came up with:
Some Notes on my Macro
I am using the matching condition because the URL can vary from http to https. I can change this even more by looking at certain URLs or Domains.
I am only concern with tracking events that I copy from the location field in Chrome or Firefox.
If the clipboard doesn't start with a URL do nothing.
I created another macro that would echo the value of ActiveURL whenever I type in show.url.
The nice thing is that I don't have to think about the activity, it just happens in the background.
There's a lot of other activity I can do with the URL, but that's a post for another day.