Created
April 18, 2013 18:02
-
-
Save brettkelly/5414877 to your computer and use it in GitHub Desktop.
AppleScript to create a new nvAlt note from the selected text in any app.
This file contains hidden or 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
-- copy selected text | |
tell application "System Events" | |
keystroke "c" using command down | |
end tell | |
-- switch to nvAlt | |
tell application "nvALT" | |
activate | |
tell application "System Events" | |
keystroke "l" using command down -- Create or Search | |
keystroke (ASCII character 8) -- Escape, clear search | |
key code 52 -- Return, enter note body | |
keystroke "v" using command down -- Paste | |
keystroke "r" using command down -- put cursor in note title field | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment