Created
October 10, 2016 22:04
-
-
Save unforswearing/4586711adc3015c642b7c72355ee1a73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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