Page 1 of 1

Working together with AutoHotkey

Posted: 13 Sep 2018 20:24
by John_C
Does anybody here use AutoHotkey and DiffMerge?

I found some strange behavior, but it's unclear is it a bug of XYplorer or is it a bug AutoHokey. In Widows Explorer it works correctly though, that's why I tend to think it is some issue with XYplorer.

Below you could see the script which will diff two files of your choice with DiffMerge utility. To test it, just select two files (in the same folder) and then press Win+D.

For some reason, SendMode, Input doesn't properly work in combination with #d. If you remove SendMode, Input or if you change hotkey to something different, e.g. #a -- everything works fine. The DiffMerge window will be opened above XYplorer window (correct behavior).

But if you keep both SendMode, Input and #d -- then DiffMerge window will be opened under XYplorer window.

Why?

Code: Select all

#SingleInstance, Force

SendMode, Input
ClipWaitTime := 2

#d::
    ClipboardSaved := ClipboardAll

    Clipboard := ""
    Send, ^c
    ClipWait, %ClipWaitTime%
    If ErrorLevel
        Return

    Clipboard := RegExReplace(Clipboard, "(.*)\r\n(.*)", """$1"" ""$2""")
    DiffMergePath := A_ProgramFiles . "\SourceGear\Common\DiffMerge\sgdm.exe"
    Run, %DiffMergePath% %Clipboard%

    Clipboard := ClipboardSaved
Return
update: It seems that #f doesn't properly work either (it behaves in the same way as #d). Hm! Very very VERY strange. What's wrong with D and F?

Re: Working together with AutoHotkey

Posted: 13 Sep 2018 20:39
by highend
The DiffMerge window will be opened above XYplorer window (correct behavior)
And that's exactly what is happening here...

Re: Working together with AutoHotkey

Posted: 13 Sep 2018 20:43
by John_C
highend wrote:And that's exactly what is happening here...
What versions of software you use?

I use Win7 with Service Pack 1, AutoHotkey is 1.1.27.07, DiffMerge is 4.2.0, XYplorer is 19.10

Re: Working together with AutoHotkey

Posted: 13 Sep 2018 20:48
by highend
Server 2k12 R2 U3, AHK 1.1.30.00, DM 4.2.0, XY as always = current beta

Re: Working together with AutoHotkey

Posted: 13 Sep 2018 20:52
by John_C
highend wrote:Server 2k12 R2 U3, AHK 1.1.30.00, DM 4.2.0, XY as always = current beta
Wohoo! Fixed in AutoHotkey 1.1.30.00. Thanks!

Re: Working together with AutoHotkey

Posted: 13 Sep 2018 21:01
by John_C
John_C wrote:Wohoo! Fixed in AutoHotkey 1.1.30.00. Thanks!
Hm. But now it doesn't work again. What's the hell is going on...