Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save smcllns/e5e1bdf89f32eaef85cb6fc629694353 to your computer and use it in GitHub Desktop.
Save smcllns/e5e1bdf89f32eaef85cb6fc629694353 to your computer and use it in GitHub Desktop.
Applescript to make a keyboard shortcut to insert today's timestamp
on run {input, parameters}
set {year:y, month:m, day:d} to (current date)
set mStr to (m as integer) as string
if (m as number) < 10 then set mStr to "0" & mStr
set dStr to (d as integer) as string
if (d as number) < 10 then set dStr to "0" & dStr
set customDateTime to y & "-" & mStr & "-" & dStr
return customDateTime as string
end run
@smcllns
Copy link
Author

smcllns commented Apr 3, 2023

  1. Open Automator on macOS
  2. Create new Quick Action
  3. Use the above code
  4. [some more steps to creating a keyboard shortcut to run that Quick Action - need to look up again]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment