Skip to content

Instantly share code, notes, and snippets.

@neurobashing
Created February 4, 2012 19:36
Show Gist options
  • Save neurobashing/1739659 to your computer and use it in GitHub Desktop.
Save neurobashing/1739659 to your computer and use it in GitHub Desktop.
get selected text in safari
tell application "Safari"
-- set tehWin to current tab of window 1
set selectedText to (do JavaScript "(''+getSelection())" in document 1)
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment