Jump to content

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

THX

Link to comment
Share on other sites

  • Moderators

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
    Sleep(100)
WEnd

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

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

    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")
    EndSwitch
EndFunc   ;==>_IEFormatSelection

Func _Exit()
    Exit
EndFunc   ;==>_Exit
Link to comment
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
 Share

  • Recently Browsing   0 members

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