?
So it's using a named argument "goto"?
And it expects a "=" after the path to go to?
And the code automatically prepends everything with:
::goto ?
Thanks for letting people guess instead of posting a link to the source code^^
In other words: Debug it yourself
This is a ahk v1 script, that (compiled) does the job correctly (apart that it expects the full script to be sent instead of prepending anything)
EverythingToolbar custom action command (ofc it expects xysend.exe to be in %PATH%):
xysend.exe ::goto %file%
Code: Select all
#NoEnv
#SingleInstance Force
SetBatchLines, -1
xyQueryScript := GetCommandLineArgString()
if (xyQueryScript = "")
{
MsgBox, 16, Error, Missing command line argument.`n`nPass the XYplorer script after the executable name.
ExitApp
}
MsgBox % xyQueryScript
Send_WM_COPYDATA(xyQueryScript, GetXYHWND())
ExitApp
GetCommandLineArgString() {
if (%0% = 0)
return ""
cmdLine := DllCall("GetCommandLineW", "Str")
self := A_ScriptName
pos := 0
if (SubStr(cmdLine, 1, 1) = """") {
pos := InStr(cmdLine, self, false, 2)
if (pos)
return Trim(SubStr(cmdLine, pos + StrLen(self) + 1))
} else {
pos := InStr(cmdLine, self, false, 1)
if (pos)
return Trim(SubStr(cmdLine, pos + StrLen(self)))
}
return ""
}
GetXYHWND() {
IfWinActive, ahk_class ThunderRT6FormDC
{
WinGet, xyHwnd, ID, ahk_class ThunderRT6FormDC
} else {
WinGet, xyHwnd, List, ahk_class ThunderRT6FormDC
if (xyHwnd)
xyHwnd := xyHwnd1
}
return xyHwnd
}
; 4194305 => Send the data as an XYplorer script
Send_WM_COPYDATA(message, hWnd) {
size := StrLen(message)
if (A_IsUnicode) {
data := message
} else {
VarSetCapacity(data, size * 2, 0)
StrPut(message, &data, size, "UTF-16")
}
VarSetCapacity(COPYDATA, A_PtrSize * 3, 0)
NumPut(4194305, COPYDATA, 0, "Ptr")
NumPut(size * 2, COPYDATA, A_PtrSize, "UInt")
NumPut(&data, COPYDATA, A_PtrSize * 2, "Ptr")
DllCall("User32.dll\SendMessageW", "Ptr", hWnd, "UInt", 74, "Ptr", 0, "Ptr", ©DATA, "Ptr")
}