You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Keyboard Shortcut to add date in all apps.

Hi - I know this has been discussed before, but the info isn't working for me.

How can I add the current date in all apps (mail, notes, word, finder etc...) using a simple kybrd shortcut in OSX.

Apologies in advance - but I'll need a step by step guide.

David

MacBook Pro 13″, macOS 11.6

Posted on Mar 29, 2022 1:02 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 29, 2022 3:55 PM

  1. Launch Automator, select Quick Action, and then click Choose.
  2. In the Quick Action heading, you want Workflow receives [ no input ] in [ any application ]. Change nothing else in that panel.
  3. In the Utilities Library, select Run Shell Script and drag/drop it into the large workflow window.
    1. Shell: /bin/zsh or /bin/bash (whichever is your default SHELL setting)
    2. Pass input: [ to stdin ]. Actually this does not matter as the workflow is not receiving any input.
    3. Copy and paste the following comments and commands shown in CODE (below) into the Run Shell Script action.
    4. In the Quick Action header, select Output replaces selected text. You do not have to select any text to have the date stamp written to the text area that you intend.
  4. Save it (it will be automatically put in the ~/Library/Services directory and you can just give it a name (e.g. DateStamp).


CODE

# Date format codes https://pubs.opengroup.org/onlinepubs/007908799/xsh/strftime.html
# Mar 29 2022
/bin/date -j +"%b %d %Y"


Now, you want to give it a keyboard shortcut. In System Preferences > Keyboard > Shortcuts > Services panel, scroll down until you encounter the Service name you have given it and this will be in the Text category of Services.


You will see the Service entry (e.g. DateStamp) and a right-column with the text none. Click none, and a [ Add Short ] button will appear in its place. Click it once, and enter the keystrokes for the shortcut. I use control-d (which will appear as ^D. Once you have done that, quit System Preferences. From a given application, you may need to manually select Application Name menu > Services > DateStamp once to apply the date string before the keyboard shortcut will work.


The Automator Quick Action will look like this when you save it.


6 replies
Question marked as Top-ranking reply

Mar 29, 2022 3:55 PM in response to David.Katz

  1. Launch Automator, select Quick Action, and then click Choose.
  2. In the Quick Action heading, you want Workflow receives [ no input ] in [ any application ]. Change nothing else in that panel.
  3. In the Utilities Library, select Run Shell Script and drag/drop it into the large workflow window.
    1. Shell: /bin/zsh or /bin/bash (whichever is your default SHELL setting)
    2. Pass input: [ to stdin ]. Actually this does not matter as the workflow is not receiving any input.
    3. Copy and paste the following comments and commands shown in CODE (below) into the Run Shell Script action.
    4. In the Quick Action header, select Output replaces selected text. You do not have to select any text to have the date stamp written to the text area that you intend.
  4. Save it (it will be automatically put in the ~/Library/Services directory and you can just give it a name (e.g. DateStamp).


CODE

# Date format codes https://pubs.opengroup.org/onlinepubs/007908799/xsh/strftime.html
# Mar 29 2022
/bin/date -j +"%b %d %Y"


Now, you want to give it a keyboard shortcut. In System Preferences > Keyboard > Shortcuts > Services panel, scroll down until you encounter the Service name you have given it and this will be in the Text category of Services.


You will see the Service entry (e.g. DateStamp) and a right-column with the text none. Click none, and a [ Add Short ] button will appear in its place. Click it once, and enter the keystrokes for the shortcut. I use control-d (which will appear as ^D. Once you have done that, quit System Preferences. From a given application, you may need to manually select Application Name menu > Services > DateStamp once to apply the date string before the keyboard shortcut will work.


The Automator Quick Action will look like this when you save it.


Keyboard Shortcut to add date in all apps.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.