Jump to content

Recommended Posts

Posted

Hi everyone,

I would like to build an AutoIt script allowing me to convert a hyperlink from the plain text format into the HTML format.

Right now I have to use a 2-step workaround like this:

- Copy the hyperlink to clipboard (I just send Ctrl+C to capture the hyperlink in plain text format)
- Call a C# program to get the hyperlink from clipboard, convert it into the HTML format, and put it back to clipboard
       - Inside the C# program I manually add some HTML segments like <!--StartFragment-->, <html><body><p>, ...
       - After adding these segments I use function Clipboard.SetData(DataFormats.Html, myHTMLText) to convert myHTMLText from plain text to HTML text and put it back to clipboard.

This method works, but it is not beautiful. I would like to do the whole thing in AutoIt. Is there any function in AutoIt which can give the same result as the above C# function Clipboard.SetData()?

Thank you.

Posted
  On 12/18/2013 at 7:43 AM, l3ill said:

Hi I3ill, thanks for your answer but from the AutoIt help file we can see that this function does not support the HTML format.

  On 12/18/2013 at 8:15 AM, karlkar said:

ClipPut is much more simple

Hi karlkar, thanks for your answer but from the AutoIt help file we can see that this function only puts text into the clipboard without any format option.

Posted

When you have your text in clipboard, then you can do something like this:

$txt = "<html><title>" & ClipGet() & "</title></html>"

ClipPut($txt)

Is that what you want or I misunderstood?

Posted

  On 12/18/2013 at 9:18 AM, karlkar said:

When you have your text in clipboard, then you can do something like this:

$txt = "<html><title>" & ClipGet() & "</title></html>"

ClipPut($txt)

Is that what you want or I misunderstood?

Hi Karlkar, thanks for your answer. I already found the solution to my problem at this article.

Posted

In the event you might be looking for a RegEx also, i am also working on >text to html stuff

FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences)

CODE SNIPPITS: Dynamic tab width (set tab control width according to window width)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...