Customizable Date variables in Keyboard Maestro
UPDATE: Though the solution below works well, I do recommend following the first commenter’s advice and using the ICUDateTime text tokens instead, which allow you to use any ICU date format, without having to invoke a shell script.
Sometimes you need a date and/or time variable in your Keyboard Maestro macros. The easiest One way I’ve found to do this is via an “Execute Shell Script” action. You’ll just use the date command and format as desired.
2 Comments
Peter N Lewis
Check out the ICUDateTime token in Keyboard Maestro, eg %ICUDateTime%yyyyMMddhhmmss%. See the ICU reference link in the Keyboard Maestro Help menu for more options.
BTW, you can get the date two business days from now with:
%ICUDateTimePlus%(DOW() = 5 | DOW() = 6) ? 4 : 2%Days%EEE, MMM d, yyyy h:mm%
Well, that will work for any weekday – it will return Monday if the current day is Saturday, but what are you doing working on a Saturday!
adam
Thanks for the tip, Peter! I’m a bit embarrassed that I missed this! I’ve updated my post.