Gleemax Posted December 17, 2009 Share Posted December 17, 2009 Hi. I can't seem to get this to work. I've been reading the forums and testing stuff and I still don't understand why it doesn't work. #include <FF.au3> #include <trimmer.au3> _FFStart("about:blank","default",1,False) $dict=ClipGet() ;Removes spaces before and after the string. $dict=_ALLTRIM($dict) ;Split the string into words. $dict2=StringSplit($dict," ") Do _FFOpenURL("http://dictionary.reference.com/browse/" & $dict2[$n],True) If _FFSearch("No results found for " & $dict2[$n]) Then If _FFSearch("Did you mean ") Then ;Need to get their suggested word. (Did you mean suggestedword?) ;Doesn't work here! $tempstring=StringRegExpReplace(_FFReadText(),'Did you mean \b([a-zA-Z]+)\b\?','\1') $dict2[$n]=$tempstring Else $dict2[$n]="" EndIf EndIf $n=$n+1 Until $n>=UBound($dict2) ;Do something here _FFQuit() Any help would be appreciated. Link to comment Share on other sites More sharing options...
Xenobiologist Posted December 17, 2009 Share Posted December 17, 2009 What is the initial string ans what should the string look like after RegExp? (I cannot run your script @work) Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Gleemax Posted December 17, 2009 Author Share Posted December 17, 2009 _FFReadText returns the entire webpage's text. I don't know if there's a more pratical/faster way to do it tho. The final string should only be the suggested word, if there's any. Else it returns blank. Link to comment Share on other sites More sharing options...
Mison Posted December 21, 2009 Share Posted December 21, 2009 Regex pattern works just fine on my system. However, I cannot run your script since I don't have FF.au3. Hi ;) Link to comment Share on other sites More sharing options...
Stilgar Posted December 23, 2009 Share Posted December 23, 2009 Hi. I can't seem to get this to work. I've been reading the forums and testing stuff and I still don't understand why it doesn't work. #include <FF.au3> #include <trimmer.au3> _FFStart("about:blank","default",1,False) $dict=ClipGet() ;Removes spaces before and after the string. $dict=_ALLTRIM($dict) ;Split the string into words. $dict2=StringSplit($dict," ") Do _FFOpenURL("http://dictionary.reference.com/browse/" & $dict2[$n],True) If _FFSearch("No results found for " & $dict2[$n]) Then If _FFSearch("Did you mean ") Then ;Need to get their suggested word. (Did you mean suggestedword?) ;Doesn't work here! $tempstring=StringRegExpReplace(_FFReadText(),'Did you mean \b([a-zA-Z]+)\b\?','\1') $dict2[$n]=$tempstring Else $dict2[$n]="" EndIf EndIf $n=$n+1 Until $n>=UBound($dict2) ;Do something here _FFQuit() Any help would be appreciated. You can read the suggested word with: ; ... If _FFSearch("Did you mean ") Then $tempstring=_FFXPath("//div[@class='dym']//a") $dict2[$n]=$tempstring Else ; .... jEdit4AutoIt PlanMaker_UDF 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