Skip to content

Instantly share code, notes, and snippets.

@brettkelly
Created April 18, 2013 18:02
Show Gist options
  • Save brettkelly/5414877 to your computer and use it in GitHub Desktop.
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.
-- 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