New command: cm_GoToNewItem

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
dragonetti
Junior Member
Junior Member
Posts: 33
Joined: 2007-07-09, 21:03 UTC

New command: cm_GoToNewItem

Post by *dragonetti »

Suggestion (request):
Could there be a command implemented which works almost like
"cm_GoToFirstFile" but now "cm_GoToNewItem" puts cursor on the last (newest) created file or folder.
(Maybe also add a command hat puts cursor on the oldest created file/folder)

Question:
Is there a way through a command to put the cursor on a specific file or folder within the left or right pane?

With "place cursor" I mean the state when you left click on a file or folder in the left or right pane. The selected file/folder becomes blue selected just like in windows explorer when you left click a file or folder. (I do not want to red mark-select file/folder).
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Select newest youngest oldest file

Post by *Stefan2 »

Take a look if this will work for you:

create an button with this internal commands:



(Select newest file)

cm_SrcByDateTime,cm_GoToFirstFile,cm_SrcByName


-or-

(Select oldest file)

cm_SrcByDateTime,cm_SrcNegOrder,cm_GoToFirstFile,cm_SrcByName





- - -

Find more commands in the "TOTALCMD.INC" text file, like:

cm_GoToFirstFile=2050;Place cursor on first file in list
cm_SrcByName=321;Source: Sort by name
cm_SrcByExt=322;Source: Sort by extension
cm_SrcBySize=323;Source: Sort by size
cm_SrcByDateTime=324;Source: Sort by date
cm_SrcUnsorted=325;Source: Unsorted
cm_SrcNegOrder=330;Source: Reversed order


- - -


How to create an button

Right click on the button bar at the top and select "Change..."

In the "Change button bar" dialog, click "Add", then fill in the properties as follows:

Command = cm_SrcByDateTime,cm_GoToFirstFile,cm_SrcByName
Parameters = <empty>
Start path = <empty>
Icon file = WCMICONS.DLL
Tooltip =

Code: Select all

Command    = <your application with full or relative path, or a TC EM_ or CM_ command>
Parameters = <parameters for your application, e.g. TCs parameter (press F1 key for help)>
Start path = <if need, or leave empty>
Icon file  = <e.g.: WCMICONS.DLL>
Tooltip    = <a hint for you, so you still know next week what this button will do>
Enable "[_]Run minimized" or Run maximized, if wanted
Then click OK to create the button.


Note:
you do not need to take care on and fill out all fields.
"Command" is mandatory, "Icon" too, else the button is not visible. "Parameters" only if need.

While button is open for modification, press F1-key for more help.

Picture: https://image.ibb.co/e9H36J/Buttonbar_Change_Eng.png

Read more at: viewtopic.php?p=287965#287965


- - -


Exchangeable Button-Code:

Code: Select all

TOTALCMD#BAR#DATA
cm_SrcByDateTime,cm_GoToFirstFile,cm_SrcByName

WCMICONS.DLL,5
Select newest file


-1
-or-

Exchangeable Button-Code:

Code: Select all

TOTALCMD#BAR#DATA
cm_SrcByDateTime,cm_SrcNegOrder,cm_GoToFirstFile,cm_SrcByName

WCMICONS.DLL,7
Select OLDEST file


-1
How to use: mark that code, copy to clipboard, next right click on TCs Button bar and choose 'Paste'
(Read more about at > https://www.ghisler.ch/board/viewtopic.php?p=335879#335879)




 
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

What if files are already sorted by date? Also it will be very slow in large dirs. It would be much faster to detect most recent item with a script and call TOTALCMD /o /S /L="path".
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

I use the following Button which always go to the newest file
in the active side, regardless of sorting.

Code: Select all

TOTALCMD#BAR#DATA
cmd.exe
/k "for /f "usebackq delims=" %%f in (`dir /b /a-d /o-d`) do start "" "%%COMMANDER_EXE%%" /O /S /L="%%~ff\:" & exit"
C:\Tools\Wincmd\Icons\Down-Blue.ico
Newest File

1
-1
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
dragonetti
Junior Member
Junior Member
Posts: 33
Joined: 2007-07-09, 21:03 UTC

Post by *dragonetti »

@Horst.Epp , Stefan2 and MVV

Wow!

Thank you all, this contains very useful information!!!
I solved the 'put cursor on newest file' issue and used this to solve other issues!

Thank you!
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

MS-DOS: Select newest youngest oldest file

Post by *Stefan2 »

MVV wrote:.
Right, I wanted to write a script myself, but then thought internal commands may work good enough. But you made a valid point there.

Horst.Epp wrote:.

Nice, well done, I will use that too.
For other readers: to select the oldest file use "/od" instead of "/o-d".
(In a black DOS-Box type "dir /?" and press enter to read more about)




 
Post Reply