delta, I like your script, just haven't had a chance to have much of a look at it so hadn't commented :-)
Tool tip dictionary
Started by
delta
, Aug 25 2005 01:08 PM
27 replies to this topic
#16
-
Posted 14 September 2005 - 09:52 AM
I like your skript, it helped me a lot, because I still have some problems with the english language. But what I needed was a request from your skript to Babelfish. Here is an example for translation english-german.
Other combinations could be easily implemented.
I used your great Script, and adjusted it to my needs, so thank you
Other combinations could be easily implemented.
I used your great Script, and adjusted it to my needs, so thank you
; _______________________________________________________ ; ; Usage: Highlight a word or a phrase and press ; the middle mouse button to display a ; translation retrieved from: ; http://babelfish.altavista.com ; ; _______________________________________________________ #UseHook ; _______________________________________________________ ; ; mousetol: The final tool tip will vanish if ; the mouse is moved more then %moustol% ; pixels away from the current position ; _______________________________________________________ mousetol = 3; ; _______________________________________________________ tempfile = tooltipdic.ttd ; _______________________________________________________ ; ; Actual script start here ; _______________________________________________________ mButton:: Begin: d = temp = %clipboard% clipboard = Send, ^c If clipboard = { clipboard = %temp% temp = return } Else { lookup = %clipboard% clipboard = %temp% temp = } ToolTip, Retrieving information on "%lookup%"... ; _______________________________________________________ ; ; Fetch dictionary entry ; _______________________________________________________ FileDelete, %tempfile% URLDownloadToFile, http://babelfish.altavista.com/babelfish/tr?doit=done&urltext=%lookup%`%0D`%0A&lp=en_de&,%tempfile% IfNotExist, %tempfile% { ToolTip, Sorry`, connection timed out.`nTry again later. MouseGetPos, X, Y GoTo, ToolTipDelete } wordfound = yes Loop, Read, %tempfile% { IfInString, A_LoopReadLine, padding:10px { StringTrimLeft, displayed, A_LoopReadLine, 56 Zeile = %A_index% IfnotInString, A_LoopReadLine, </div> { loop { ;msgbox, %Anhang%, %tempfile%, %Zeile% Zeile+=1 FileReadLine, Anhang, %tempfile%, %Zeile% displayed = %displayed% %Anhang% IfInString, displayed, </div> break ; Zeile+=1 } } StringGetPos, trim, displayed, </div> StringLeft, displayed, displayed, trim If offset > 0 displayed = %displayed%%A_Space%(continued) } IfInString, A_LoopReadLine, not found { wordfound = no break } } MouseGetPos, X, Y ; _______________________________________________________ ; ; Output found words ; _______________________________________________________ full_entry = %displayed% If wordfound = yes { ToolTip, %full_entry% } Else ToolTip, Sorry`, no match found. ; _______________________________________________________ ; ; Wait for mouse movement to delete ToolTip. ; If there is more to display also detect, if ; the left mouse button is clicked. ; _______________________________________________________ ToolTipDelete: Loop { MouseGetPos, Xn, Yn Sleep, 50 If (Abs(X - Xn) > mousetol || Abs(Y - Yn) > mousetol) break If more = 1 { GetKeyState, LB, LButton If LB = D { more = 0 GoTo Begin ; Go back and start it all over again ; to display the next page } } } offset = 0 ToolTip return
#17
-
Posted 17 September 2005 - 11:18 PM
@delta
Your script fulfills one of my issues
http://borumat.de/au... ... uebergeben
(german language)
Thank you.
My ideas for improvements:
1 A variable with a clear comment at the top of the script, where a user could declare his target website.
Mine e.g. is:
2 The motive of most scripts is to be faster
Perfect for this in our situation - searching a selected word - is in my humble opinion a mouse gesture.
The user often uses his mouse to select a word in the middle of a text.
Then, the fastest way to perform a function is: a mouse gesture.
I don't know if a nice GUI to create mouse gestures exists yet.
I think that the extension "mouse gestures" for mozilla could be inspiring:
http://optimoz.mozdev.org/gestures/
Your script fulfills one of my issues
http://borumat.de/au... ... uebergeben
(german language)
Thank you.
My ideas for improvements:
1 A variable with a clear comment at the top of the script, where a user could declare his target website.
Mine e.g. is:
http://dict.leo.org/?search=%s
2 The motive of most scripts is to be faster
Perfect for this in our situation - searching a selected word - is in my humble opinion a mouse gesture.
The user often uses his mouse to select a word in the middle of a text.
Then, the fastest way to perform a function is: a mouse gesture.
I don't know if a nice GUI to create mouse gestures exists yet.
I think that the extension "mouse gestures" for mozilla could be inspiring:
http://optimoz.mozdev.org/gestures/
#19
-
Posted 20 September 2005 - 09:35 AM
Andreas
http://borumat.de/au...nd-makros-tipps (german)
http://borumat.de/th...ird-email-tipps (german)
http://borumat.de/fi...x-browser-tipps (german)
http://borumat.de/au...nd-makros-tipps (german)
http://borumat.de/th...ird-email-tipps (german)
http://borumat.de/fi...x-browser-tipps (german)
@Andreas
Have a look at the script section, there are several mouse-gesture scripts.I don't know if a nice GUI to create mouse gestures exists yet.
You can change your own version with a gosub Label or variable, and put it at the beginning of the skript.1 A variable with a clear comment at the top of the script, where a user could declare his target website.
Mine e.g. is:
#20
-
Posted 20 September 2005 - 10:36 AM
@delta
What do you think about a mouse gesture as default for your script?
Because I'm not a programmer:
Would you, or someone else, be so kind to post your script with the suggested variable for the target website?
What do you think about a mouse gesture as default for your script?
Because I'm not a programmer:
Would you, or someone else, be so kind to post your script with the suggested variable for the target website?
#21
-
Posted 20 September 2005 - 10:56 AM
Andreas
http://borumat.de/au...nd-makros-tipps (german)
http://borumat.de/th...ird-email-tipps (german)
http://borumat.de/fi...x-browser-tipps (german)
http://borumat.de/au...nd-makros-tipps (german)
http://borumat.de/th...ird-email-tipps (german)
http://borumat.de/fi...x-browser-tipps (german)
I have found useful to integrate this script With (Auto copy selected test to clipbord, thanks pwy), so that pressing CTRL and evidencing the text with the left mouse , to the release of the mouse, the translation appears.
However there is the problem that for text with many words ,the tooltip with translation, is looked at on a single line, and can be seen only little words.
I do not know for other languages, but the translation English-Italian, Italian-English, on babelfish is terrifying.
I have try on the situated one of Google, but the translate text turns out of all equal, precise one to that one translate with Altavista-babelfish. Evidently they use the same one to sofware.
Is possible find better translation?
Thanks.
However there is the problem that for text with many words ,the tooltip with translation, is looked at on a single line, and can be seen only little words.
I do not know for other languages, but the translation English-Italian, Italian-English, on babelfish is terrifying.
I have try on the situated one of Google, but the translate text turns out of all equal, precise one to that one translate with Altavista-babelfish. Evidently they use the same one to sofware.
Is possible find better translation?
Thanks.
#22
-
Posted 24 September 2005 - 09:39 AM
Loriss
This is just so tremendous! I love this script! I inserted the below to make it automatically select the last word and the tool tip just comes right up, it's so neat. I really thank you for this script. I'd like to make it so that the tool tip gets taken away when you hit the end key, too. (Me, I'm a mouse hater). Anyway, this one put a smile on my face!
^!s:: ; Set this shortcut key { clipboard = Send, +^{LEFT} Send, ^c }
#23
-
Posted 01 October 2005 - 02:50 PM
This looks very interesting indeed - a good alternative to Babylon Translator*!
However I can't try it atm cuz a proxy is required for the connection to work...
* I never used Babylon's own dictionaries anyway and went for the WordNet glossary as my primary source. As that is freely available AFAIK (at least it's used in a number of tools, e.g. WordWeb), it might be incorporated here!?
However I can't try it atm cuz a proxy is required for the connection to work...
* I never used Babylon's own dictionaries anyway and went for the WordNet glossary as my primary source. As that is freely available AFAIK (at least it's used in a number of tools, e.g. WordWeb), it might be incorporated here!?
#24
-
Posted 02 June 2006 - 12:29 PM
oh yes great thank dictionnary run good
and script's garath is so génial grand merçi !)
Voiçi the french version of garat's script for traduction English > French
and script's garath is so génial grand merçi !)
Voiçi the french version of garat's script for traduction English > French
; _______________________________________________________ ; ; Usage: Highlight a word or a phrase and press ; the middle mouse button to display a ; translation retrieved from: ; http://babelfish.altavista.com --> en_fr ; ; _______________________________________________________ #UseHook ; _______________________________________________________ ; ; mousetol: The final tool tip will vanish if ; the mouse is moved more then %moustol% ; pixels away from the current position ; _______________________________________________________ mousetol = 30; ; _______________________________________________________ tempfile = tooltipdic.ttd.htm ; ______________________________________________________ ; ; Actual script start here ; _______________________________________________________ mButton:: Begin: d = TransPart1 = http://babel.altavista.com/tr?doit=done&urltext= TransPart2 = &lp= Translang = en_fr TempString = %clipboard% Send , ^c Clipwait TransText = %clipboard% clipboard = %tempstring% ; temp = %clipboard% ; clipboard = ; Send, ^c ; If clipboard = ; { ; clipboard = %temp% ; temp = ; return ; } ; Else ; { ; lookup = %clipboard% ; clipboard = %temp% ; temp = ; } ToolTip, TRAduction en cours! ; "%TransText%"... ; _______________________________________________________ ; ; Fetch dictionary entry ; _______________________________________________________ FileDelete, %tempfile% URLDownloadToFile , %TransPart1%%TransText%%TransPart2%%TransLang%, %tempfile% ; URLDownloadToFile, http://babelfish.altavista.com/babelfish/tr?doit=done&urltext=%lookup%&lp=en_fr&,%tempfile% IfNotExist, %tempfile% { ToolTip, Sorry`, connection timed out.`nTry again later. MouseGetPos, X, Y GoTo, ToolTipDelete } wordfound = yes Loop, Read, %tempfile% { IfInString, A_LoopReadLine, padding:0.6em { StringTrimLeft, displayed, A_LoopReadLine, 49 Zeile = %A_index% ;msgbox, %Anhang%, %tempfile%, %Zeile% IfnotInString, A_LoopReadLine, </div> { loop { Zeile+=1 FileReadLine, Anhang, %tempfile%, %Zeile% displayed =%displayed%. %Anhang% IfInString, displayed, </div> break ; Zeile+=1 } } StringGetPos, trim, displayed, </div> StringLeft, displayed, displayed, trim If offset > 0 displayed = %displayed%%A_Space%(continued) } IfInString, A_LoopReadLine, not found { wordfound = no break } } MouseGetPos, X, Y stringreplace , displayed, displayed, `.%A_SPACE% , `.`n, All ; _______________________________________________________ ; ; Output found words ; _______________________________________________________ full_entry = %displayed% If wordfound = yes { Tooltip %full_entry% } Else ToolTip, Sorry`, no match found. ; _______________________________________________________ ; ; Wait for mouse movement to delete ToolTip. ; If there is more to display also detect, if ; the left mouse button is clicked. ; _______________________________________________________ ToolTipDelete: Loop { MouseGetPos, Xn, Yn Sleep, 50 If (Abs(X - Xn) > mousetol || Abs(Y - Yn) > mousetol) break If more = 1 { GetKeyState, LB, LButton If LB = D { more = 0 GoTo Begin ; Go back and start it all over again ; to display the next page } } } offset = 0 ToolTip return ; _______________________________________________________
#26
-
Posted 11 September 2008 - 09:10 AM
It would be possible now that there is Google Translator, use this url that translates much better?
http://translate.google.com/
Thankyou.
http://translate.google.com/
Thankyou.
#27
-
Posted 09 October 2008 - 05:23 PM
Loriss
It would be possible now that there is Google Translator, use this url that translates much better?
http://translate.google.com/
Thankyou.
Could you customize this code to see the translation from Russian to English which uses google translator.
Kgc
#28
-
Posted 14 October 2008 - 02:15 PM