View Single Post
Quote:
Originally Posted by Sébastien View Post
Any idea to perform this action ? (Using an applescript maybe ? I have checked the applescript dictionary of OO, but i did not found the "link" keyword...)
For fairly deep and intractable architectural reasons Applescript can not really manipulate RTF text. If it were something that I really needed to do, and performance were not an issue, I might explore something like:
  • Capturing the RTF data from the OO row by placing its text in the clipboard, and extracting the raw rtf data from there.
    Code:
    set dataRTF to the clipboard as «class RTF »
  • Writing the RTF data out to a file
  • Converting the RTF file to HTML with a textutil command line
  • Performing some string operations on the HTML to wrap potential links with <a HREF tags
  • Converting the HTML back to RTF, again with textutil
  • Capturing the TextEdit RTF version (now with clickable links) into the clipboard
  • Replacing the OO row contents with the clipboard contents.

Maybe the OO mouse operation doesn't seem so bad now :-)

--

Last edited by RobTrew; 2010-10-31 at 12:43 PM..