Jump to content
Sign in to follow this  

Help Find An HTML Script

Recommended Posts

I found a script a while back and finally found a good reason to use it. It was a script that let you highlight a word and then you click a button on the menu and could make it bold, italic, underlined etc by adding the needed code to the beginning and end of the highlighted word. I'm gonna continue my search but thought maybe the author would stumble upon my post before i find it


Share this post

Link to post
Share on other sites

Something like this?

#include <IE.au3>

HotKeySet("^b", "_IEFormatSelection")
HotKeySet("^i", "_IEFormatSelection")
HotKeySet("^u", "_IEFormatSelection")
HotKeySet("^x", "_IEFormatSelection")
HotKeySet("^v", "_IEFormatSelection")

HotKeySet("{ESC}", "_Exit")

$sURL = "www.autoitscript.com"

$oIE = _IECreate($sURL)

While 1

Func _IEFormatSelection()
    $oTextRange = $oIE.document.selection.createRange

    If Not $oTextRange.text Then
        MsgBox(0, "", "You must first select some text.")

    Switch @HotKeyPressed
        Case "^b"
            $oTextRange.execCommand ("Bold")
        Case "^i"
            $oTextRange.execCommand ("Italic")
        Case "^u"
            $oTextRange.execCommand ("Underline")
        Case "^x"
            $oTextRange.execCommand ("Cut")
        Case "^v"
            $oTextRange.execCommand ("Paste")
EndFunc   ;==>_IEFormatSelection

Func _Exit()
EndFunc   ;==>_Exit

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...