Working together with AutoHotkey

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
John_C
Posts: 336
Joined: 16 May 2018 20:04

Working together with AutoHotkey

Post 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?

highend
Posts: 15004
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Working together with AutoHotkey

Post by highend »

The DiffMerge window will be opened above XYplorer window (correct behavior)
And that's exactly what is happening here...
One of my scripts helped you out? Please donate via Paypal

John_C
Posts: 336
Joined: 16 May 2018 20:04

Re: Working together with AutoHotkey

Post 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

highend
Posts: 15004
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Working together with AutoHotkey

Post by highend »

Server 2k12 R2 U3, AHK 1.1.30.00, DM 4.2.0, XY as always = current beta
One of my scripts helped you out? Please donate via Paypal

John_C
Posts: 336
Joined: 16 May 2018 20:04

Re: Working together with AutoHotkey

Post 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!

John_C
Posts: 336
Joined: 16 May 2018 20:04

Re: Working together with AutoHotkey

Post 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...

Post Reply