Skip to content

Instantly share code, notes, and snippets.

@elasticthreads
Created August 24, 2011 18:07
Show Gist options
  • Save elasticthreads/1168725 to your computer and use it in GitHub Desktop.
Save elasticthreads/1168725 to your computer and use it in GitHub Desktop.
fix for Safari 5.1's "do Javascript" bug where it can't just "getSelection()"
tell application "Safari"
set selecTxt to (do JavaScript "var x = ''+document.getSelection();x" in current tab of front window) as string
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment