Page 2 of 2

Re: Workaround for scan popup functionality

PostPosted: Wed Jul 24, 2013 3:49 pm
by Blessing
I'm really interested in using this on Chrome
I tried the three codes here, but none seems to work anymore on Chrome 28
Anyone still using this successfully on Chrome?
I also particularly want to use this on adobe reader... but they do not work too

Re: Workaround for scan popup functionality

PostPosted: Wed Jul 24, 2013 5:11 pm
by wlhunag
Of course it works since then.
I still use it in Chrome 28

Code: Select all
~LButton::

  Loop {
  LButtonDown := GetKeyState("LButton","P")
  If (!LButtonDown)
     Break
  }

WaitTime:=DllCall("GetDoubleClickTime")/4500
KeyWait, LButton, D T%WaitTime%
If errorlevel=0
   GoSub, Routine
Return

Routine:
{
clipboard =
   ifwinactive ahk_class CabinetWClass
   {
      return
   }

   ifwinactive ahk_class ATL:000000014015A8C0
   {
   return
   }
 
  sleep,50
   send ,{Ctrl down}c{Ctrl up}

   clipboard = %clipboard%
   ClipWait,0.05
         StringLen, cliplen, clipboard
      if cliplen > 20
      {
      ;avoid non-English string
         return
      }
      if cliplen < 2
      {
      ;avoid non-English string
         return
      }
run D:\XXXXXX\GoldenDict\GoldenDict.exe  %clipboard% 
;   send,{Ctrl down}cc{Ctrl up}

   return
}

return


Please edit the last third line, so that it match the GoldenDict folder you use now. For example:
Code: Select all
run D:\Downloads\Dictionaries\GoldenDict-1.5.0-RC-11-g6a39192_(QT_4_8_4)(Abs62)\GoldenDict\GoldenDict.exe  %clipboard% 

Re: Workaround for scan popup functionality

PostPosted: Thu Jul 25, 2013 10:56 am
by Blessing
wlhunag wrote:Of course it works since then.
I still use it in Chrome 28

Code: Select all
~LButton::

  Loop {
  LButtonDown := GetKeyState("LButton","P")
  If (!LButtonDown)
     Break
  }

WaitTime:=DllCall("GetDoubleClickTime")/4500
KeyWait, LButton, D T%WaitTime%
If errorlevel=0
   GoSub, Routine
Return

Routine:
{
clipboard =
   ifwinactive ahk_class CabinetWClass
   {
      return
   }

   ifwinactive ahk_class ATL:000000014015A8C0
   {
   return
   }
 
  sleep,50
   send ,{Ctrl down}c{Ctrl up}

   clipboard = %clipboard%
   ClipWait,0.05
         StringLen, cliplen, clipboard
      if cliplen > 20
      {
      ;avoid non-English string
         return
      }
      if cliplen < 2
      {
      ;avoid non-English string
         return
      }
run D:\XXXXXX\GoldenDict\GoldenDict.exe  %clipboard% 
;   send,{Ctrl down}cc{Ctrl up}

   return
}

return


Please edit the last third line, so that it match the GoldenDict folder you use now. For example:
Code: Select all
run D:\Downloads\Dictionaries\GoldenDict-1.5.0-RC-11-g6a39192_(QT_4_8_4)(Abs62)\GoldenDict\GoldenDict.exe  %clipboard% 

Thank you so much! It works so well!!
Just one more thing though (ignore me if you don't have time)
Is it possible to change the behavior to launching scan pop-up when highlighting text but not just a double click?
This will be useful when I want to look up the definition of a phrase.
Thank you again~

Re: Workaround for scan popup functionality

PostPosted: Thu Jul 25, 2013 11:20 am
by wlhunag
Blessing wrote:Is it possible to change the behavior to launching scan pop-up when highlighting text but not just a double click?
This will be useful when I want to look up the definition of a phrase.

I don't know.
I just use Ctrl +CC in such situation.

Re: Workaround for scan popup functionality

PostPosted: Thu Jul 25, 2013 11:51 am
by Blessing
wlhunag wrote:
Blessing wrote:Is it possible to change the behavior to launching scan pop-up when highlighting text but not just a double click?
This will be useful when I want to look up the definition of a phrase.

I don't know.
I just use Ctrl +CC in such situation.

I see... Your script is more than amazing already
Now I can fully enjoy using GoldenDict in Chrome 8-)

Re: Workaround for scan popup functionality

PostPosted: Mon Oct 21, 2013 12:12 pm
by Robert Webber
Yeah, it supports Internet Explorer 9, but not firefox 4+! What the hell? I have also tried in opera, chrome and safari. Works really well in all the browsers except Firefox! I think the developers are somewhat allergic to Firefox!

Re: Workaround for scan popup functionality

PostPosted: Fri Oct 25, 2013 12:43 pm
by chulai
Robert Webber wrote:Yeah, it supports Internet Explorer 9, but not firefox 4+! What the hell? I have also tried in opera, chrome and safari. Works really well in all the browsers except Firefox! I think the developers are somewhat allergic to Firefox!

No, I personally like Firefox but it's not easy to implement scan popup feature in modern browsers. For more info read https://github.com/goldendict/goldendict/issues/29 and https://github.com/goldendict/goldendict/pull/26