Wet Behind the Years
a collection of, um, stuff

        

Subscribe to "Wet Behind the Years" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.


Thursday, January 9, 2003
 

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    comment []



Click here to visit the Radio UserLand website. © Copyright 2003 Gordon Meyer.
Last update: 5/29/03; 10:30:47 PM.
January 2003
Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Dec   Feb