0

I made an AutoHotKey script that does the following on an Alt + Click:

  • Double-clicks on the current position
  • Selects a word
  • Copies the word to the clipboard
  • Activates a second program
  • Pastes the word into the program (a dictionary)
  • Presses Enter

The problem is that it sometimes works in 80-90% of applications - in others it will work much less, sometimes only getting as far as pasting the text but not pressing Enter.

Below is the script so far, any ideas how to get it fully working?

!LButton::
IfWinExist PCD 
{
    Click 2
    Send, ^c
    WinActivate PCD
    WinWaitActive, PCD
    Send, ^v
    Send {Enter}
}
return

1 Answer 1

1

maybe the problem is a delay of the double click action (any mouse action has a default 10milisecond delay), you could add a sleep 20 or more after that line. Other thing is that SendInput is more faster than Send so you could try with this code:

!LButton::
IfWinExist PCD 
{
    Click 2
    sleep 50
    SendInput, ^c
    WinActivate PCD
    WinWaitActive, PCD
    SendInput, ^v{Enter}
}
return

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .