codeswitcher: A rainbow splash of paint exploding upward (Default)
codeswitcher ([personal profile] codeswitcher) wrote in [community profile] cs_hackerary2022-03-07 11:15 pm
Entry tags:

Datestamping in MacOS

Okay, I finally figured out how to make a nigh-universal (~all app) keystroke command which will plop the current date stamp, in the format of my chosing, wherever the cursor is.

This was a ridiculous amount of effort.

But as of right now, I have a service in Users/$me/Library/Services/PutDate that I have mapped to the Keyboard Shortcut (in System Preferences > Keyboard > Shortcuts) shift-option-Apple-d. Works fine.

Internally, it's pretty grody. Apparently if you want a date and a time, the only way to concatenate them into the same string is by calling out to a... shell script? Or so saith this discussion on discussions.apple.com.

This other discussion on discussions.apple.com shows exactly what I want to do, but doesn't actually work in practice because of an apparently unresolveable permissions error. Apparently when it says "any such application" what it means is any application you want this to work in has to be manually granted the permission to run the script in the sys prefs, which ha ha ha, omg no.

At least doing it the other way, I get to format the date/time to my liking!


Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting