Skip to content

Instantly share code, notes, and snippets.

@ace-dent
Created April 3, 2015 22:19
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ace-dent/45f71c2aeb254db1eecd to your computer and use it in GitHub Desktop.
Save ace-dent/45f71c2aeb254db1eecd to your computer and use it in GitHub Desktop.
Insert today's date in Mac OS X. Add as a Service via Automator using AppleScript, to create a Shortcut.
on run
# TODAY - Returns today's date!
# Create your own Service, to avoid 3rd Party software (WordService, etc.)
# In Automator:
# > Service receives 'no input' in 'any application'
# > Output replaces selected text
# Add Shortcut (e.g. Ctrl+Cmd+T - it's hard to find a free shortcut!):
# > Preferences > Keyboard > Keyboard Shortcuts > Services
# When setting up Keyboard Shortcut, *exit* the target app before testing. (It seems shortcuts are only refreshed when app is launched)
# Adjust 'Short' Date format
# > Preferences > Language & Text > Region.
return short date string of (get current date)
end run
# Sources:
# http://apple.stackexchange.com/questions/100642/how-to-make-an-existing-applescript-file-to-work-as-a-service
# http://henrysmac.org/blog/2014/1/4/formatting-short-dates-in-applescript.html
@jsmayo
Copy link

jsmayo commented Nov 13, 2018

Thanks for this :)

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