Previous month:
May 2013
Next month:
July 2013

Keyboard Maestro: An update to Make Link With Title From Clipboard

In Keyboard Maestro: Make Link With Title From Clipboard I wrote about a macro that I frequently use while writing for the web. It uses Keyboard Maestro, and a bit of Python, to create a full-formed hyperlink that automatically includes the title of the page you're linking to. It's super-handy.

Well, the new Keyboard Maestro v6.0 ameliorated my use of Python in that macro. The new version supports built-in Safari (and Chrome) queries for the URL and title of a document. This allowed me to greatly simplify the macro.

With the old version, you had to copy a URL to your clipboard, activate the macro, then paste the result. The workflow is slightly different in this version. You need to have the target page open (frontmost) in Safari when you activate the macro. Then, paste the result. In other words, the clipboard is only used as output, not also as input.

It would be possible to change the macro so that the clipboard is not used at all; the result could instead be inserted into the current editing context as if it were typed. That requires too much forethought, in my opinion, so I'm not using it that way.

The new macro is shown below, and is available in this gist, too. Read the afore-linked post about the old macro for more detail about the what, why, and how.

KM hrefsafari


Update a Status Board webcam image using Javascript

I wanted to add a favorite webcam to Status Board, on my iPad, but I ran into a couple of hiccups. First, you can't add an HTML module that points directly to an img file. You have to wrap the image with a complete HTML document. (Panic's support quickly confirmed this for me.)

Secondly, even though I was loading an HTML page that included the img, I found that it was not updating regularly. (As in, never.) Panic's online help suggested that a refresh isn't such a great idea, so I dusted off my javascript skills (hardly) and cooked up a simple page that reloads every 5 minutes. I also add the current time to the end of the img url to defeat any caching. The webcam ignores the bogus argument, but it ensures that I get a fresh image every time.

I've put the code in this gist, if you'd like to adapt it. Finding an explanation of how to do this simple task took a surprisingly large amount of searching.


Quickly grab a Street View image of your location

I've gotten into the habit of using DayOne and Rego to keep track of places that I'd like to remember. I've also found that having a snapshot of the location is both useful and appealing. (Particularly if you share the location with someone using Rego's nifty sharing feature.)

However, it's not always convenient to take a photo of the outside of a location. Breaking away from your friends to go stand in the busy street and take a photo, like a tourist, is sometimes both logistically and socially impossible. And many times you'll get a hurried, dark, or crappy photo anyway. Trust me, I speak from experience.

To solve this problem, I wrote a web app that utilizes Google Map's massive collection of Street View photos. I call it Get Street View Image.

Visit that URL on your iPhone and you'll see four Street View photos of your current location. One for each compass heading: North, South, East, and West. To advance a view by 45-degrees, tap it, giving you a total of 8 views to choose from. The web app uses the most accurate location measurement available, and each image has the widest field-of-view that Google permits, to facilitate getting a good shot even when Street View or your location data is a little less than spot-on.

Touch and hold the photo you like best, then choose Save Image from the pop-up menu that appears. The photo is saved to your Camera Roll where you can use it your favorite app, send it using iMessage or Mail, post it on Facebook, stash it in Evernote, tweet it, or,…well, you get the idea.

Additionally, the web app displays your current coordinates and full URLs for each of the photos. They're put in text fields so they're easy to copy. Just tap the field, then tap Select All and Copy. These are handy if you don't need a picture, but just a link or longitude/latitude.

Once a photo is in your Camera Roll, you can crop it to further improve the image. Some apps might do this for you, since many use the oh-so-hip square format. The image below is one that I grabbed while dining at a local gourmet hot dog place, The Haute & The Dog.

IMG 3888

And here's how I put it to use in Rego.

It would be great if location-based apps supported this sort of thing themselves (I've suggested it to the folks at Rego) but until they do, I hope you find this web app as useful.