This forum uses cookies. Click X button to hide this message. What is stored? / Privacy
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New command: cm_GoToNewItem

 
Post new topic   Reply to topic    Total Commander Forum Index -> TC suggestions (English) Printable version
View previous topic :: View next topic  
Author Message
dragonetti
Junior Member
Junior Member


Joined: 09 Jul 2007
Posts: 33

PostPosted: Thu May 17, 2018 1:16 am    Post subject: New command: cm_GoToNewItem Reply with quote

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).
Back to top
View user's profile Send private message
Stefan2
Power Member
Power Member


Joined: 13 Sep 2007
Posts: 1879
Location: Europa

PostPosted: Thu May 17, 2018 2:13 am    Post subject: Select newest youngest oldest file Reply with quote

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 = wciconex.dll
Tooltip =


Code:

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.: wciconex.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: https://ghisler.ch/board/viewtopic.php?p=287965#287965


- - -


Exchangeable Button-Code:
Code:
TOTALCMD#BAR#DATA
cm_SrcByDateTime,cm_GoToFirstFile,cm_SrcByName

WCMICONS.DLL,5
Select newest file


-1


-or-

Exchangeable Button-Code:
Code:
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)




 
_________________
Begegnen sich zwei Erden, sagt die Eine zur Anderen: "Mir geht's echt schlecht. Ich habe Homo sapiens!"
Back to top
View user's profile Send private message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 8011
Location: Russian Federation

PostPosted: Thu May 17, 2018 8:27 am    Post subject: Reply with quote

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".
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
Horst.Epp
Power Member
Power Member


Joined: 06 Feb 2003
Posts: 2878
Location: Germany

PostPosted: Thu May 17, 2018 9:55 am    Post subject: Reply with quote

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

Code:

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 10 x64 Version 1803
April 2018 Update (OS Build 17134.81)
TC 9.20b4 x64 and x86
Back to top
View user's profile Send private message
dragonetti
Junior Member
Junior Member


Joined: 09 Jul 2007
Posts: 33

PostPosted: Thu May 17, 2018 10:02 am    Post subject: Reply with quote

@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!
Back to top
View user's profile Send private message
Stefan2
Power Member
Power Member


Joined: 13 Sep 2007
Posts: 1879
Location: Europa

PostPosted: Fri May 18, 2018 2:08 am    Post subject: MS-DOS: Select newest youngest oldest file Reply with quote

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)




 
_________________
Begegnen sich zwei Erden, sagt die Eine zur Anderen: "Mir geht's echt schlecht. Ich habe Homo sapiens!"
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> TC suggestions (English) All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Imprint/Impressum: This site is maintained by Ghisler Software GmbH
Privacy Policy | Datenschutzerklärung | Politique de Confidentialité

Using phpBB © phpBB Group