Sign in to follow this  
Followers 0
bobbyab9987

Convert a hyperlink from plain text format into HTML format

7 posts in this topic

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.

Share this post


Link to post
Share on other sites



ClipPut is much more simple

Share this post


Link to post
Share on other sites

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

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0