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.
Other changes: The Reader macro now checks for empty selection and uses the clipboard if nothing is selected. So you can run the macro either on selected text, or on existing clipboard content.
I’m the wrong addressé for that question. I’m still learning Swift (yeah, still, months of doing nothing in respect), and, so, for me it it is a moving target. But I guess, while learning a language, that language is always a “moving target”, by definition. And so, I don’t really care about changes. I’m happy that the language is evolving, and I’m applying the changes to my production programs (currently just 1; so, no major efforts)
Not exactly sure what you mean. As mentioned, I’m not the best source for the latest news on Swift.
What I know is the function for AppleScripts: NSAppleScript. This is wikified.