Skip to content

Instantly share code, notes, and snippets.

@unforswearing
Created October 10, 2016 22:04
Show Gist options
  • Save unforswearing/4586711adc3015c642b7c72355ee1a73 to your computer and use it in GitHub Desktop.
Save unforswearing/4586711adc3015c642b7c72355ee1a73 to your computer and use it in GitHub Desktop.
tell application "System Events"
set w1 to the name of first application process whose frontmost is true
tell w1
tell application "System Events"
key code 0 using command down
key code 8 using command down
set bodytext to the clipboard
set the clipboard to bodytext as string
tell application "Notational Velocity"
activate
tell application "System Events"
key code 9 using {command down, shift down}
end tell
end tell
end tell
end tell
end tell
tell application "Notational Velocity"
set newnote to display dialog "Create a NV note" default answer ""
set newnote to text returned of newnote
tell application "Finder" to set the clipboard to newnote as text
tell application "Notational Velocity"
activate
tell application "System Events"
key code 15 using command down
tell application "Notational Velocity"
activate
tell application "System Events"
key code 9 using command down
key code 36
key code 36
key code 36
key code 36
end tell
end tell
end tell
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment