Тема: AHK: Everything.exe
Привет! Подскажите, почему не работает второй хоткей?
Функцию взял здесь.
#SingleInstance Force
SetTitleMatchMode 2
^+vk47:: ; g
@:=Clip()
Run http://www.google.com/search?q=%clipboard%
Clip(@)
return
CapsLock & vk46:: ; f
@:=Clip()
RunWait, Everything.exe, C:\Program Files\Everything\
ControlSetText, Edit1, %Clipboard%, Everything
Clip(@)
return
Clip(Text="", Reselect="")
{
Static BackUpClip, Stored, LastClip
If (A_ThisLabel = A_ThisFunc) {
If (Clipboard == LastClip)
Clipboard := BackUpClip
BackUpClip := LastClip := Stored := ""
} Else {
If !Stored {
Stored := True
BackUpClip := ClipboardAll ; ClipboardAll must be on its own line
} Else
SetTimer, %A_ThisFunc%, Off
LongCopy := A_TickCount, Clipboard := "", LongCopy -= A_TickCount ; LongCopy gauges the amount of time it takes to empty the clipboard which can predict how long the subsequent clipwait will need
If (Text = "") {
SendInput, ^c
ClipWait, LongCopy ? 0.6 : 0.2, True
} Else {
Clipboard := LastClip := Text
ClipWait, 10
SendInput, ^v
}
SetTimer, %A_ThisFunc%, -700
Sleep 20 ; Short sleep in case Clip() is followed by more keystrokes such as {Enter}
If (Text = "")
Return LastClip := Clipboard
Else If (ReSelect = True) or (Reselect and (StrLen(Text) < 3000)) {
StringReplace, Text, Text, `r, , All
SendInput, % "{Shift Down}{Left " StrLen(Text) "}{Shift Up}"
}
}
Return
Clip:
Return Clip()
}