Hi, many programs have support for file links and I can pass those file links to XYplorer. When passing a file link to XYplorer, then it goes to the folder and selects the file.
Can I make XYplorer somehow use it's PFA and open the file directly when a file link is passed to XYplorer? I didn't find any suitable command line switches and XYplorer.exe /script="::open"myfile.ext"" tries to open a folder path.
And it all would happen silently in the background, when XY in minimized, then it should stay minimized!
File links from other programs + XYplorers PFA.
Re: File links from other programs + XYplorers PFA.
Your open... command is quoted incorrectly.
use /script="::open '<path to your file>\file.ext';" /flg2
This uses PFA...
Invoking XY with a command line comes at a cost: It will automatically restore from minimized mode
Alternatively: Write e.g. an .ahk script that sends the command + file via WM_COPYDATA to XY
and then it will not restore from that state. Ofc you need to invoke that "mediator" from your application instead of XY.
use /script="::open '<path to your file>\file.ext';" /flg2
This uses PFA...
Invoking XY with a command line comes at a cost: It will automatically restore from minimized mode
Alternatively: Write e.g. an .ahk script that sends the command + file via WM_COPYDATA to XY
and then it will not restore from that state. Ofc you need to invoke that "mediator" from your application instead of XY.
One of my scripts helped you out? Please donate via Paypal
Re: File links from other programs + XYplorers PFA.
Sometimes the file links can also be folder paths, how can I use the return values of the exists command to open folders in a new tab, because folder paths also exist, but they are opened in Windows Explorer
This AHK script is working, except folder paths are opened in WE
This AHK script is working, except folder paths are opened in WE
Code: Select all
Process, Exist, XYplorer.exe
If Not ErrorLevel {
Run, XYplorer.exe
sleep, 1000
}
Script = :: if (exists("%1%")) {open "%1%";} elseif {tab("new", "%1%");} else {msg "File/Folder %1% Not Found"}
WM_COPYDATA := 74 ; 0x4A
HWND := WinExist("ahk_class ThunderRT6FormDC")
DWData := 4194305
Size := StrLen(Script)
If !(A_IsUnicode) {
VarSetCapacity(Data, Size * 2, 0)
StrPut(Script, &Data, "UTF-16")
} Else {
Data := Script
}
VarSetCapacity(COPYDATA, A_PtrSize * 3, 0)
NumPut(DWData, COPYDATA, 0, "Ptr")
NumPut(Size * 2, COPYDATA, A_PtrSize, "UInt")
NumPut(&Data, COPYDATA, A_PtrSize * 2, "Ptr")
Result := DllCall("User32.dll\SendMessageW", "Ptr", HWND, "UInt", WM_COPYDATA, "Ptr", 0, "Ptr", ©DATA, "Ptr")
;MsgBox, %Result%
;MsgBox, %1%
Re: File links from other programs + XYplorers PFA.
Code: Select all
if (exists("%1%") == 2) { //goto folder} elseif ((... == 1) {// open file}
One of my scripts helped you out? Please donate via Paypal
Re: File links from other programs + XYplorers PFA.
Change this:to this:
XY treats 0 as false and non-zero as true, so when exists return 1 (for files) or 2 (for folders) the if condition treats them both as true.
Code: Select all
Script = :: if (exists("%1%")) {open "%1%";} elseif {tab("new", "%1%");} else {msg "File/Folder %1% Not Found"}
Code: Select all
Script = :: $i="%1%";$e=exists($i);if($e==1) {open $i;} elseif ($e==2) {tab("new", $i);} else {msg "File/Folder $i Not Found"}
Re: File links from other programs + XYplorers PFA.
Wow, that was fast, thanks