View Single Post
That solution works perfectly. Thanks.

Quote:
Originally Posted by whpalmer4 View Post
By the way, not that learning how to do this with a script is a bad thing, but what's wrong with File->Mail Link to This Page?
The way I have it set up, now, the second half of the script inserts those variables into an email template in Mail.app and sends it to a pre-set address. The script resides in my Scripts folder, and is accessible from the AppleScript menu bar item. So the current procedure is to browse to a page I want to send (I have multiple copies of the script for a couple different receiver addresses), select the appropriate script from the menu, and go back to browsing. Pull-down a menu, click a menu item. Done. The "Mail Link to This Page could do the same thing, but adds a couple of steps because I still have to start typing the recipient's name, then click "send." It's a nice functionality, and I'm sure I'll use it if I'm sending a page to somebody I don't already have a script for, but I'm used to my way and my way still saves a few seconds.

The final script:
Code:
-- Based on script made by Scott Haneda
-- http://osxhelp.com
-- 02/13/2008

-- Get the current URL
tell application "OmniWeb"
	set windowID to id of front window
	set windowInfo to GetWindowInfo windowID
	set thisPage to first item of windowInfo
	set thisTitle to second item of windowInfo
end tell

-- Create a new email message in mail.app
tell application "Mail"
	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:"example@example.com", «class rdsn»:"FirstName LastName"}
		set the subject to "URL from Moof"
		set the content to "This is an URL sent from an AppleScript for speed's sake: 
		
" & thisTitle & "
" & thisPage & "

--
Moof"
	end tell
	send this_message -- Send the email message
end tell