Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Fully automated, one-step sending of a URL from Safari' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Fully automated, one-step sending of a URL from Safari
Authored by: chueewowee on Sep 21, '08 08:18:59AM
Here's a modified version that includes selected text as well as URL , as a quote from the page. I like it.

-- Script made by Scott Haneda...modified John Plumridge 2008
-- http://osxhelp.com
-- 02/13/2008

-- Get the current URL
tell application "Safari"
	activate
	set the clipboard to ""
	tell application "System Events" to keystroke "c" using command down
	set myCount to count (the clipboard)
	if myCount = 0 then
		display dialog "Oops, you forgot to select some text in Safari." & return & return & "Please select the text you want to include in your email and try again." buttons {"OK"} default button "OK"
		return
	end if
	set SelectedText to the clipboard
	set thisPage to do JavaScript "document.URL" in document 1
	set PageName to name of front document
end tell

-- Create a new email message in mail.app
tell application "Mail"
	activate
	set this_message to make new outgoing message at beginning of every outgoing message
	tell this_message
		make new to recipient at beginning of to recipients 
			with properties {address:"name@server.com", «class rdsn»:"FirstName LastName"}
		set the subject to PageName
		set the content to "Hey, I thought you would be interested in this link: 
" & thisPage & "
QUOTE:
" & SelectedText & "
--
Signature Here"
		
		
	end tell
	send this_message -- Send the email message
end tell

-- Restore Safari to the foreground, hide mail.app
tell application "System Events" to set visible of first process whose name is "Mail" to false
tell application "Safari"
	activate
end tell


[ # ]