An AppleScript to send an email about a page in Safari
Feb 06, '08 07:30:03AM
Contributed by: tomschmidt
When I find a web page that might be of interest to someone I know, I send an email suggesting they have a look. I want this email to be short and enable the recipient to decide quickly if the page is, in fact, of interest. The email usually includes some text from the page, a link, and a comment from me.
But, if you do it often, this recipient-friendly approach becomes labor intensive for the sender. There's too much copying, pasting, and application switching. Hence this Applescript. It puts text you select in Safari into a new Mail message within quotation marks, appends the page link, and puts the page name into the email's subject field. Add a comment, if you wish, and press send.
To install:
- Copy the script.
- Open the application Script Editor and paste the script into the window.
- Name and save the script in your user's Library/Scripts/Safari folder (create the folders as necessary).
- If you have not already done so, use Applescript Utility to show the Scripts menu in the menu bar.
To use: In Safari, select the text for your email, then run the script by selecting it in the scripts menu in the menu bar.
[robg adds: I tested this and it worked as described. For the save location, however, I would recommend your user's Library » Scripts » Applications » Safari folder. By placing it here, you'll see it listed directly in a 'Safari Scripts' section of the Scripts menu when you're in Safari. If you store it just in the Scripts/Safari folder, then it will appear in a Safari sub-menu of the Scripts menu.
Note that you can do most of this without the script, simply by selecting the text on the page, copying it, then pressing Shift-Command-I (File » Mail Link to This Page). Mail will open with the page title filled in as the subject, along with the link to the page in the body of the message. Enter a recipient in the To line, click into the body, and press Command-V to paste the copied text. If you do this a lot, though, this script will save some time and key presses.]
Comments (17)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20080129120714204