Thursday, March 12, 2009

Clipboard to speech

Here some easy steps to make your computers to talk to you!

Open a Notepad.exe and write down the following Visual Basic Script and Save As "speak.vbs"

Dim objHTML, sapi, textToRead
Set objHTML = CreateObject("htmlfile")
Set sapi = CreateObject("sapi.spvoice")
textToRead = objHTML.ParentWindow.ClipboardData.GetData("text")
msgbox "ClipboardReader will read:" & vbCr & vbCr & textToRead
sapi.Speak textToRead

Just copy the text you want to hear to clipboard and run speak.vbs (by double clicking on it).

You can comment message box pop up section in script, to get less nervious just add ' to the beginning of line
'msgbox "ClipboardReader will read:" & vbCr & vbCr & textToRead

I've added a shortcut in start menu which is running on Ctrl+Alt+S.

You can download VBScript from here speak.vbs

1 comment:

Gregg said...

Very useful tool Vahik,