A Send URL script for Safari
The only feature that I miss with Safari is an easy way to copy a URL into an email message. So, I took a few minutes and created a very simple AppleScript.
This creates a new mail message with the URL and Title of the frontmost Safari window. It also adds a couple of blank lines after the URL so you can easily type a note to go with it.
If it fails (because there is no Safari window open, for example) it will just die silently. Ideally, it would also wrap the URL with "< >" to help with email clients that can't handle long lines, but I'll leave that as an exercise for the reader.
try
tell application "Safari"
set theurl to URL of document 1
set thetitle to the name of the window 1
end tell
set thetitle to "Website: " & thetitle
open location "mailto:" & "?subject=" & thetitle & "&body=" & theurl &
return & return
end try
To use it, paste the above in Script Editor, Check Syntax, then save as
a Compiled Script. Put it in ~/Library/Scripts/Safari. (You'll have to
create the Safari folder unless you've already installed some other
scripts.)
Then, for best access, run the Script Menu in
/Applications/AppleScript. You'll see your Safari folder, and the
script, in the Scripts menu so you can easily invoke it.
11:20:52 AM
|