Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
share|improve this question

1 Answer 1

up vote 1 down vote accepted

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.