Since KM now supports Swift scripts, I thought why not use Swift instead of AppleScript or Shell scripts? (ahem… and mainly to practice Swift, which I’m trying to learn…)
It turned out that Swift as script language works nicely with KM! In this case, I think, it may be even a very good way to go.
These are mainly example macros. But if you are using timestamps they may indeed be useful
The first macro, Timestamp Creator, creates a timestamp and copies it to the clipboard. You can choose from…
- Unix Time (1970) or Apple’s Cocoa Time (2001) and…
- one of these representations: Decimal, Hex, Base-36, Binary
This is the macro structure:
It comes with an accompanying macro Timestamp Reader, which – you guessed it – will convert a timestamp to a readable date format. It tries to be smart and detect automatically format (Unix/Cocoa) and encoding (Decimal, Hex, Base-36, Binary):
You find more screenshots, documentation and the download on my blog post.
Note: Works only with Keyboard Maestro 7.