Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save fractaledmind/6213803 to your computer and use it in GitHub Desktop.

Select an option

Save fractaledmind/6213803 to your computer and use it in GitHub Desktop.
This script gets the selected text, page title, and URL from your current Chrome tab and exports to TextMate (or TextEdit, see the comment)
tell application "Google Chrome"
set LF to (ASCII character 32) & (ASCII character 32) & (ASCII character 10)
copy selection of active tab of window 1
delay 0.1
set theTitle to title of active tab of window 1
set theURL to URL of active tab of window 1
set FinalText to "[" & theTitle & "](" & theURL & ")" & LF & "\"" & (the clipboard) & "\"" & LF & LF & LF
tell application "TextMate"
insert FinalText
end tell
(* If you don't have TextMate, here's the script for the universal Mac program TextEdit. To alter the code, merely delete or comment-out the TextMate tellblock and uncomment this block:
*)
-- tell application "TextEdit"
-- activate
-- make new word at end of text of document 1 with data FinalText
-- end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment