Created
August 12, 2013 18:47
-
-
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)
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
| 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