Automating Simple Mail Text Replacement

Joined
Jan 22, 2007
Messages
5
Reaction score
0
I have never wrapped my mind around Applescript. What I'm trying to do is this. Given an open Apple Mail message, take the selected text and do something with it. So, for example, the message reads:

-----------
Hey! Check out this link:

Code:
12345
-----------
and the 12345 is selected. I want to have that replaced with:

-----------
Hey! Check out this link:

Code:
{url=http://www.foo.com/12345}{img}http://www.foo.com/images/12345}{/img}{/url}
-----------

(I've substituted curly brackets for square ones so as not to confuse the forum software overly.) I'd love to do this in Ruby, which is second nature, but I don't know of a way to invoke that from the Mail menu. So much for open scripting. Hence my question, how the heck does one write Applescript and navigate the object model?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top