This macro was inspired by some similar discussions in these two threads:
I have a solution that seems to work and is incredibly fast, but as it's an entirely different approach, I think it may sidetrack the other treads, so chose to post it on its own. First, here's the macro:
Super fast screen capture and rename.kmmacros (16 KB)
This macro takes over the built-in ⇧⌘3 (full screen) and ⇧⌘4 (region) shortcuts, so in order to work, you must disable ⇧⌘3 and ⇧⌘4. Do that in System Settings → Keyboard → Keyboard Shortcuts → Screenshots.
The advantage of this method is that (a) it's wicked fast, and (b) it doesn't have to use folder monitoring to find newly-taken screenshots. Instead, it's just a macro that's triggered when you take a screenshot, because it steals those keyboard shortcuts.
The macro has two variables you must set, both in green boxes. The first is the location where you want the final screenshots to go; this does not need to be the location used by the system's screenshot tool, and you can use tilde-style shortcuts if you want, as shown in the uploaded macro.
The second variable is the extension for your screenshot type. Unless you changed it using a Terminal command, this should be png
, so leave it unchanged if you're uncertain.
With those things done, the macro fires on either shortcut, and then uses the proper screencapture
Terminal command (based on checking %TriggerValue%
) to capture either the screen or region to a file in the /tmp
folder. An input box then lets you rename the file, and it's saved to your chosen location. (The macro will tell you and force you to pick a new name if you try to use an existing filename.)
In testing, I can capture and rename a screenshot in about a second, with most of that time being typing. This works because the Terminal command bypasses the preview icon and the associated delay that you get when you use the built-in tool.
I have some thoughts on enhancements, for instance an option to not rename the files and just use a format that matches the system's built-in style would result in a wicked-fast screenshot tool. I'll do that, though, only if there's general interest in such a feature.
-rob.