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

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Horst
Posts: 1090
Joined: 24 Jan 2021 12:27
Location: Germany

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

Post 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.
Last edited by Horst on 26 Jan 2021 11:37, edited 1 time in total.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1372a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73

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

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

Post 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, "|");
One of my scripts helped you out? Please donate via Paypal

Horst
Posts: 1090
Joined: 24 Jan 2021 12:27
Location: Germany

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

Post 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.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1372a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73

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

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

Post by highend »

No problem and thanks :beer:
One of my scripts helped you out? Please donate via Paypal

Post Reply