Created
February 5, 2017 09:28
-
-
Save melangue/33c521c3df849c4106c1fd3f7b9a498d to your computer and use it in GitHub Desktop.
Easily copy your text selection + url, title from current tab in Safari and today's to clipboard. Useful for referencing.
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
-- Safari - this copies Title, URL, Date (current tab) and text which you highlighted to the clipboard | |
-- originally from here: https://discussions.apple.com/thread/4561056?tstart=0 | |
-- modified to show tab's Title. | |
-- I recommend assigning it to a shortcut, ctrl + c for example. | |
-- V | |
tell application "Safari" | |
activate | |
set theURL to URL of front document | |
set theTitle to name of front document | |
set selectedText to (do JavaScript "(''+getSelection())" in document 1) | |
set theDate to do shell script "date +'%d-%m-%Y'" | |
set the clipboard to theTitle & return & theURL & return & selectedText & return & theDate as string | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment