- Open
Automatorand createQuick Action. - In the middle column, look for
Run AppleScript - On the right, choose
no inputforworkflow receives - input
on run {input, parameters}
set dateString to do shell script "date +'(%m/%d/%y %H:%M %p)'"
tell application "System Events"
keystroke dateString
end tell
return input
end run
- save it
Insert Datetime - open
Keyboard->Shortcuts->Services->General, checkInsert Datetimeand assign it with a preferred keyboard shortcut. (preferred Shift + Ctrl + Cmd + T) - Allow the apps to AppleScripts: Security & Privacy -> Privacy -> Accessibility -> Whatever app you tried to run the AppleScript.
Trouble Shooting
“System Events got an error: Automator Workflow Runner (WorkflowServiceRunner, Insert Datetime) is not allowed to send keystrokes.
Security & Privacy -> Privacy -> Accessibility -> Whatever app you tried to run the AppleScript.