À la bonne Sainte-Force

Tools

Tags

Porkcuts

11 July 2012

Dear friend,

Porkcuts is a simple per-project keyboard shortcut manager and… Wait a minute. I remember saying that before… Oh, yeah, that's Workcuts, not Porkcuts. So, what is Porkcuts ?

Porkcuts is a context-sensitive shortcut manager. Basically, it allows you to perform frequently used custom commands, like so many shortcut managers out there, but it's different, because it presents you a menu containing only the shortcuts that are relevant to the file you're manipulating in your current application (if any). You do this by invoking Porkcuts, that is, either by hitting a special keyboard shortcut (⌘⌥⌃Space by default), clicking the menu icon, or showing the dock menu. If you want to skip the usual logorrhea and install the software, go straight to the Download section.

A pork whose sharp teeth can cut.
A pork whose sharp teeth can cut.

To make a brief comparison for those moronic Workcuts users, with Workcuts you had several sets of shortcuts, one per project, and you had to switch between them, either manually or programmatically. Here, switching to other shortcuts is done by switching to other documents. The theory is the following: you work on something urgent, you're late, you need a complex command, it's 3AM, you don't even have time to relieve yourself, so you don't want to hassle with something to choose the shortcuts you're interested in, because the time you search for the right shortcut set your bladder may explode, filling the room with hundreds of those kidney stones you never knew you had. The happier end of this story is this : you're a trained Porkcuts user, and because of this, you're late in your work, so you need your custom commands to work faster, and you just have to invoke Porkcuts to make your shortcut appear, which allows you to finish your work in no time and to sing happily in your way to the bathroom.

Now that we know the basic purpose of Porkcuts and have a clear idea of how it can be useful to your life, let's talk about what it does in detail by pretending we're working on an important letter in Pages, the word processor. Our file path is /Users/poupou/Documents/Project X/Letter.pages. You have downloaded Porkcuts, it's running in the background, quietly waiting for the next opportunity to help you. When you invoke Porkcuts, it shows a menu. To build this menu, Porkcuts will look at a special file, called the Porkcuts file, in the directory of your letter. Here, it'll look into the folder /Users/poupou/Documents/Project X for any file that looks like a Porkcuts file and load it. It's written in a weird scripting language, but we'll come back to this later. Porkcuts may have filled your menu with some useful commands pertaining to your Project X, but it won't stop there. It'll also look into /Users/poupou/Documents for a Porkcuts file, and then in /Users/poupou, and so on until it can't move up further in the folder hierarchy. Once it's done, it'll show your menu, filled with many shortcuts. What's beautiful is that they all relate to your letter in some way. Some are there because your letter belongs to Project X. Some are there because it is a document. Some are there simply because that letter is a file of yours. The Sainte-Force hypothesis is that this containment relationship is useful to work with, when dealing with shortcuts about documents.

The last point you may want to know is how to specify your damn shortcuts ? First, create a Porkcuts file in the right place. To speed up the process, you can go to that place using the Finder, then invoke Porkcuts and select Edit…, which will create the right file, fill it with some help and open it for you. You'll have to write Porkcuts files with F-Script, a nice scripting language that leverages all the power of Mac OS X with a classy syntax. The F-Script language is like Smalltalk for Cocoa and perfectly fits the requirements for an open-ended solution like this. The finest feature of Porkcuts is that it isn't limited to that little menu: you can script anything in Cocoa, load NIBs, bundles, program a 3D game if you want… More than a way to program shortcuts, it's a way to directly script the system using the large API base of Mac OS X. For sure, you'll need some learning time ! If reading the Porkcuts files doesn't help you, please refer to the F-Script and the Cocoa documentations.

Please note that the mysterious creature depicted is a porc-shark. Like the yin doesn't exist without the yang, this porc-shark calls for his complementary, the shark-porc. Hopefully, the complementary of Porkcuts will ship very soon.

Download

Porkcuts is now in version 1.1 ! See what has changed if you care.

In the unlikely event that it should not work, you can still have Porkcuts 1.0 (Mac OS X 10.6+).

  1. I fear I'm talking to myself and no one else.
  2. The possible names for Porkcuts files are: Porkcuts.fscript, porkcuts.fscript, Porkcuts, porkcuts, .porkcuts.fscript and .porkcuts. Nothing else, baby.

Looking forward to hearing from you,
Hubert Sainte-Force