Skip to content

Instantly share code, notes, and snippets.

@junjizhi
Created April 8, 2019 03:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save junjizhi/21d26fe95cf169ba7b8e6fa448616c04 to your computer and use it in GitHub Desktop.
Save junjizhi/21d26fe95cf169ba7b8e6fa448616c04 to your computer and use it in GitHub Desktop.
Applescript: Insert Date and A Horizontal Divider Line
on run {input, parameters}
set _Date to short date string of (current date)
set _DividerLine to "-----------------------------------------------------------------------------------------------"
set clipboard_contents to (the clipboard)
set the clipboard to _Date & return & _DividerLine & return
tell application "System Events" to keystroke "v" using command down
delay 0.2 -- needed because otherwise the next command can run before the paste occurs
set the clipboard to clipboard_contents
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment