Page 1 of 1

[Solved] Script or Hotkey to go to newest file in the file list

Posted: 26 Jan 2021 10:26
by Horst
Is there a script or hotkey which positions the cursor to the newest file in the current displayed file list.

In my other File manager (Total Commander) I used a button like this:
cmd.exe /k "for /f "usebackq delims=" %%f in (`dir /b /a-d /o-d`) do start "" "%%COMMANDER_EXE%%" /L="%%~ff\:" & exit"
%%COMMANDER_EXE%% is the current running Total Commander.

In XYplorer I tried a User command like this:
"Cmd.exe" /k "for /f "usebackq delims=" %%f in (`dir /b /a-d /o-d`) do start "C:\Tools\XYplorer\XYplorer.exe" /path="%%~ff\:" & exit"
It isn't working, no errors shown and the cursor is not moved at all.

Re: Script or Hotkey to go to newest file in the file list

Posted: 26 Jan 2021 11:13
by highend
You want that to be a user defined button in XYplorer itself?

Code: Select all

    $files = trim(report("{modified yyyy-mm-dd hh:nn:ss}|{fullname}<crlf>", listfolder(, , 1)), <crlf>);
    goto gettoken(gettoken(formatlist($files, "r", <crlf>), 1, <crlf>), 2, "|");

Re: Script or Hotkey to go to newest file in the file list

Posted: 26 Jan 2021 11:33
by Horst
highend wrote: ↑26 Jan 2021 11:13 You want that to be a user defined button in XYplorer itself?

Code: Select all

    $files = trim(report("{modified yyyy-mm-dd hh:nn:ss}|{fullname}<crlf>", listfolder(, , 1)), <crlf>);
    goto gettoken(gettoken(formatlist($files, "r", <crlf>), 1, <crlf>), 2, "|");
Thats what I searched for, works perfect.
You are very helpful for a XYplorer beginner.
I made a small donation with PayPal.

Re: Script or Hotkey to go to newest file in the file list

Posted: 26 Jan 2021 11:34
by highend
No problem and thanks :beer: