• Tech Tips

    Keyboard Maestro “Insert text by pasting” Quick Tip

    “Insert text by pasting” is faster than “Insert text by typing” (which is rarely necessary in my experience).

    Unfortunately, using the paste method results in unwanted junk in your clipboard (unless of course this is also your intention). You can insert by pasting without having it store the text into your clipboard by adding a “Delete Past Clipboard” action just after the insert. Despite the name of the action, this will only remove the last item from your clipboard (not the entire contents of the clipboard).

    Screenshot_2015-11-23_05-21-34

  • Tech Tips

    Installing ElasticSearch on Webfaction

    You read everywhere that setting up and running elasticsearch is very simple. In fact, it is. There are some hurdles to clear when you’re setting it up on Webfaction, however. These instructions will hopefully provide some guidance.

  • Tech Tips

    Automatic Dropshadow and Border on Mac OS X Screenshots

    If you’re like me, you take lots of screenshots. I probably average 20 a day. Primarily I use CMD-SHIFT-4 and drag a box around what I want to capture. The result is exactly what I highlighted. Here’s an example:

    Screenshot_2015-10-09_09-53-06_original

    That looks fine, except there’s nothing that really helps the image stand out. It’s not ready for blog posts, documentation, or wherever else you’d like to use an image. I’ve approached the problem a few different ways in the past, but I’ve finally settled on a Keyboard Maestro-based solution for “Automatic” processing of these screenshots. I also have created a “Drop shadow” Service so you can apply a dropshadow to any image by right-clicking and using the Services menu.

  • Development,  Tech Tips

    Automatic Screenshots of Drupal Content

    In an earlier post I recommended webkit2png for automatically screenshotting a list of URLs. A lot of time has passed since that post, and I’ve discovered a more robust tool. Pageres is incredible, and it has a CLI and an api.

    I’ll let you discover, on your own, what the Pageres tool can do. I needed to take screenshots of all of the content types on a site, at all of the important resolutions. Here’s a quick Drupal function I threw together to get N number of random nodes per content type:

  • Tech Tips

    Keyboard Maestro – Looping Through Each Line of the Clipboard

    This graphic illustrates how you can loop through each line of the clipboard and use the line’s value for some purpose. It also demonstrates how to handle the first line differently than the others.

    This is zero-based. The second time through the loop will say “Line number 1” if you use the exact setup below. If you need your  i  variable to be “1” on the first loop, just move the  i + 1 calculation above the If All Conditions Met Execute Actions and change the  i is 0  to i is 1. Alternatively you could start i as 1 and change the i is 0  to i is 1.

    Screenshot_2015-09-06_07-17-17

  • Tech Tips

    Detecting When You’re “Away” or “Back” in Your Keyboard Maestro Macros

    Your Mac knows the last time you moved the mouse or pressed a keyboard key. We can use this information in Keyboard Maestro to perform actions based on whether we’ve “gone away” from or have “come back” to our computer. I’m using this technique to set my status in Slack to “Away” if I step away from my computer for more than 10 minutes, and back to “Active” when I return. Here are a few quick examples that could use this same basic framework:

    • Automatically pause music if I step away
    • Show me a “Welcome back!” message when I return
    • Write the date/time to a log file the when I go away and when I return

    Setup your macro with a “Periodically while logged in” trigger. In the example here I’m using 10 seconds because I want no more than 10 seconds to pass before my system detects that I’ve returned to my desk. The macro isn’t very CPU-hungry so 10 seconds shouldn’t be problematic.
    Screenshot_2015-07-28_07-52-16

  • Development,  Tech Tips

    Easy Dummy Text using Python Faker and Keyboard Maestro

    Yet again I’ve found a great use for Keyboard Maestro. I’m a web developer and often have to create “filler” or “dummy” text during development. In the past I’ve used Alfred workflows, copy-and-paste, browser extensions, and more. I’ve recently come up with a much cleaner (and more powerful) solution to achieving field-by-field or one-off dummy text.

    What do I mean by field-by-field and one-off? Well, I use tools sometimes to automate filling an entire form repeatedly (Fake, Selenium, iMacros, etc.). I’ve even written a Selenium extension to inject random text into the fields Selenium is automatically filling. Unfortunately, this all takes time. Sometimes I just need to fill some fields in a form a few times and move on. It’s not worth automating at that point. Enter Keyboard Maestro.

  • Development,  Tech Tips

    Keyboard Maestro URL Handler (KMLink) – Introduction and Basic Usage

    Keyboard Maestro offers many ways to trigger macros, but unfortunately there isn’t a URL handler that lets you trigger macros via a URL. There are a number of keyboardmaestro://  URLs handled by the built-in url scheme, but executing a macro isn’t an option. If you’re interested in triggering macros via bookmarklets and Finder shortcuts, read on…

    I’ve written a URL handler that allows you to execute macros and pass variables to them. It’s a simple app that registers a URL handler to process kmlink:// links.

  • Tech Tips

    Trigger a Keyboard Maestro Macro with a Finder Shortcut / Icon

    Using the Keyboard Maestro URL Handler (KMLink), you can create clickable shortcuts that you can use in Finder to trigger KM macros. Why would this be helpful? I have a macro that synchronizes my tracked time between two different applications. I wanted to trigger this with a simple mouse click, but didn’t want to tie it to a hotkey. I wanted it to feel more like “running an application.” So, I created the shortcut and moved it into my ~/Documents directory. Then, I right-clicked and chose “Get Info” and gave it a nice icon. Lastly, I dragged the item into my dock. Now I have a really nice icon that I can click whenever I want to sync my time.