An AppleScript to email Safari URLs via PowerMail

Mar 26, '03 09:18:00AM

Contributed by: pdxguy

In the same spirit as the recent An AppleScript to email Safari URLs with titles via Mail hint, I offer a similiar one but for PowerMail instead. It uses the wonderful Extra Suites background scripting application, from KANZU Utilites to position the focus of the newly-created email draft at the recipient email address field ready for addressing.

tell application "Safari"
  set theURL to URL of front document
  set theTitle to name of front window
end tell

tell application "PowerMail"
  set theURL to "<" & theURL & ">" & return
  set newMsg to make new message �
    with properties {subject:theTitle, content:theURL}
  open newMsg
  activate
  -- remove next 2 lines if Extra Suites
  -- not available
  delay 1
  tell application "Extra Suites" to type key "tab" with shift
end tell
[robg adds: The need for this hint may be eliminated by the Safari/email JavaScript hint, which should open your default email application, but I don't have another email client to test that theory with ... and with this, we now have three separate hints on emailing from Safari, so I think the topic is sufficiently covered!]

Comments (2)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030323080323818