JohnCleese Posted August 14, 2009 Share Posted August 14, 2009 (edited) Hello,Is is possible to make an auto word correcting function?Where as I type "ello" it will then automatically (or upon pressing space) convert "ello" to "hello".I know this is possible with AutoHoykey so I figure there must be something similar in AutoIt.I was messing around with this.HotKeySet("1" + "2", "Test1") Func Test1() TrayTip("Congrats", 1, 1) EndFunc While(1) WEndJust to get the input string (Hotkey) to work, but obviously that's not going to work. So if anyone could provide assistance I will be very grateful. PS: Depending on the speed at which this gets a response, I may not reply because I'm taking off for the next couple days. However I'll make sure to reply with my thanks when I'm back. >_<EDIT: Also note, I'm not trying to get it to replace all of the "ello" strings, only the ones I type while it's running. Edited August 14, 2009 by JohnCleese "I find it rather easy to portray a businessman. Being bland, rather cruel and incompetent comes naturally to me." Link to comment Share on other sites More sharing options...
Yashied Posted August 14, 2009 Share Posted August 14, 2009 Hello, Is is possible to make an auto word correcting function? Where as I type "ello" it will then automatically (or upon pressing space) convert "ello" to "hello". I know this is possible with AutoHoykey so I figure there must be something similar in AutoIt. I was messing around with this. HotKeySet("1" + "2", "Test1") Func Test1() TrayTip("Congrats", 1, 1) EndFunc While(1) WEnd Just to get the input string (Hotkey) to work, but obviously that's not going to work. So if anyone could provide assistance I will be very grateful. PS: Depending on the speed at which this gets a response, I may not reply because I'm taking off for the next couple days. However I'll make sure to reply with my thanks when I'm back. >_< EDIT: Also note, I'm not trying to get it to replace all of the "ello" strings, only the ones I type while it's running. What is meant by "1" + "2": only "1", only "2", or both? My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
JohnCleese Posted August 14, 2009 Author Share Posted August 14, 2009 What is meant by "1" + "2": only "1", only "2", or both?I was trying to get it to take it in order. So if I type 1 then 2 side by side it would perform the function.But I discovered it's actually just doing the math so when I press three it performs the function. >_< I doubt in the end it will be using a Hotkey at all. "I find it rather easy to portray a businessman. Being bland, rather cruel and incompetent comes naturally to me." Link to comment Share on other sites More sharing options...
colafrysen Posted August 14, 2009 Share Posted August 14, 2009 Do you want an Dictonary? or just a few words for a few words, use an 2D array Dim $aReplacments[3][2] = [["ello", "Hello"],["odbye", "Goodbye"],["Tjeeenare", "Tjenare"]] #include <Array.au3> ConsoleWrite( _ReplaceWord($aReplacments, "ello") & @CRLF) Func _ReplaceWord($aReplacments, $Word) $Index = _ArraySearch($aReplacments, $Word) If $Index <> -1 Then Return $aReplacments[$Index][1] Else Return -1 EndIf EndFunc ;==>_ReplaceWord [font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size] Link to comment Share on other sites More sharing options...
JohnCleese Posted August 14, 2009 Author Share Posted August 14, 2009 Dim $aReplacments[3][2] = [["ello", "Hello"],["odbye", "Goodbye"],["Tjeeenare", "Tjenare"]] #include <Array.au3> ConsoleWrite( _ReplaceWord($aReplacments, "ello") & @CRLF) Func _ReplaceWord($aReplacments, $Word) $Index = _ArraySearch($aReplacments, $Word) If $Index <> -1 Then Return $aReplacments[$Index][1] Else Return -1 EndIf EndFunc ;==>_ReplaceWord Thanks for the suggestion, I'll look into arrays more for future refrence. Though I couldn't manage to get the above script working. (It ran fine, but didn't seem to do anything) Anyways, I found an easier way to do it using autohotkey and autoit scripts together. >_< Also for anyone interested the AutoHotkey function was. PutUni(DataIn) { SavedClip := ClipBoardAll ClipBoard = If RegExMatch(DataIn, "^[0-9a-fA-F]+$") { Loop % StrLen(DataIn) / 2 UTF8Code .= Chr("0x" . SubStr(DataIn, A_Index * 2 - 1, 2)) } Else UTF8Code := DataIn Transform, ClipBoard, Unicode, %UTF8Code% Send ^v Sleep 100 ;Generous, less wait or none will often work. ClipBoard := SavedClip return } "I find it rather easy to portray a businessman. Being bland, rather cruel and incompetent comes naturally to me." Link to comment Share on other sites More sharing options...
colafrysen Posted August 14, 2009 Share Posted August 14, 2009 It didn't even write "Hello" in the console? [font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size] Link to comment Share on other sites More sharing options...
JohnCleese Posted August 14, 2009 Author Share Posted August 14, 2009 It didn't even write "Hello" in the console?Sorry this is starting to go over my head. I'm thinking you mean dos console? "I find it rather easy to portray a businessman. Being bland, rather cruel and incompetent comes naturally to me." Link to comment Share on other sites More sharing options...
colafrysen Posted August 14, 2009 Share Posted August 14, 2009 Ahh, no i meant the SciTE console, just below your code (if you use SciTE), Thats where ConsoleWrite() puts it's text. But you could use a InputBox and MsgBox as well #include <Array.au3> Dim $aReplacments[3][2] = [["ello", "Hello"],["odbye", "Goodbye"],["Tjeeenare", "Tjenare"]] MsgBox(0, "Replacement...", _ReplaceWord($aReplacments, InputBox("", "Enter Word"))) Func _ReplaceWord($aReplacments, $Word) $Index = _ArraySearch($aReplacments, $Word) If $Index <> -1 Then Return $aReplacments[$Index][1] Else Return -1 EndIf EndFunc ;==>_ReplaceWord [font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size] Link to comment Share on other sites More sharing options...
JohnCleese Posted August 14, 2009 Author Share Posted August 14, 2009 Ahh, no i meant the SciTE console, just below your code (if you use SciTE), Thats where ConsoleWrite() puts it's text.But you could use a InputBox and MsgBox as wellOh, I see. Yea the above script works in replacing the words. I could probably get that to work by saving the clipboard, then copy & pasting the array.However, just for the hell of it. Could you upload a pic of the scite console. I don't see it at all, I use SciTE4AutoIt3 as my .au3 editor. "I find it rather easy to portray a businessman. Being bland, rather cruel and incompetent comes naturally to me." Link to comment Share on other sites More sharing options...
Valuater Posted August 14, 2009 Share Posted August 14, 2009 John, make sure you have the full version of SciTE. It must be downloaded separate from the Autoit install. The Autoit install has a minimum version included 8) Link to comment Share on other sites More sharing options...
colafrysen Posted August 14, 2009 Share Posted August 14, 2009 Oh, I see. Yea the above script works in replacing the words. I could probably get that to work by saving the clipboard, then copy & pasting the array. However, just for the hell of it. Could you upload a pic of the scite console. I don't see it at all, I use SciTE4AutoIt3 as my .au3 editor. Heres a picture of the console: [font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size] Link to comment Share on other sites More sharing options...
JohnCleese Posted August 15, 2009 Author Share Posted August 15, 2009 John, make sure you have the full version of SciTE. It must be downloaded separate from the Autoit install. The Autoit install has a minimum version included 8) Ah ok, thanks for the info, will do. >_< Heres a picture of the console: Oohhh lol, the output console. I thought that might have been it. Anyways thanks for that. Although, so using your original script. Where would I have to type ello, for it to be replaced with hello? Would I type it into the output panel? "I find it rather easy to portray a businessman. Being bland, rather cruel and incompetent comes naturally to me." Link to comment Share on other sites More sharing options...
colafrysen Posted August 15, 2009 Share Posted August 15, 2009 It was not meant to be inputed by user, as an example only it was right hereConsoleWrite( _ReplaceWord($aReplacments, "ello") & @CRLF) [font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now