Focus on file after renaming via

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
TvE
Junior Member
Junior Member
Posts: 12
Joined: 2022-03-17, 22:53 UTC
Location: Denmark

Focus on file after renaming via

Post by *TvE »

I have received lot's of good help here viewtopic.php?p=450989 and have a shortcut that prepends my file with a timestamp - (probably one of my most used actions in TCM).

Now remains only one issue: The file I am renaming is not kept in focus after the renaming.

Initial listing

Code: Select all

2024-12-24_2359 file already present.jpg
New File.jpg <- Focus on this new file as it needs to get a timestamp prepended
After Renaming (via my new great CTRL+ALT+T shortcut)

Code: Select all

2024-12-14_1302 New File.jpg
2024-12-24_2359 file already present.jpg <- Focus
Focus is still on the second file in the list, but the renamed file has moved due to the new name hence another file is now in focus and I need to manually select the renamed file in order to perform further actions to it

I'm not sure if this is to be considered a bug or a missing feature, but it sure would be great to figure out how to avoid this behavior.
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Focus on file after renaming via

Post by *petermad »

2TvE

You don't show us which command you have assigned to your CTRL+ALT+T shortcut - but this command keeps the cursor on the file after prepending the date:

Code: Select all

cmd=cm_RenMov
param=/GH0T="%|$DATE:Y-M-D_hm| %Q%N"
or as a button:

Code: Select all

TOTALCMD#BAR#DATA
cm_RenMov
/GH0T="%|$DATE:Y-M-D_hm| %Q%N"
WCMICONS.DLL,32
Prepend name of the file under the cursor with current date and time

0
-1
To make the button:
1. Mark the text in the box here above (click SELECT ALL).
2. Copy it to the ClipBoard (press Ctrl+C).
3. Right click on TC's buttonbar and choose "Paste".
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
sa16
Senior Member
Senior Member
Posts: 324
Joined: 2021-09-10, 07:15 UTC

Re: Focus on file after renaming via

Post by *sa16 »

petermad wrote:You don't show us which command you have assigned to your CTRL+ALT+T shortcut
Apparently MULTIRENAME is used.
TvE
Junior Member
Junior Member
Posts: 12
Joined: 2022-03-17, 22:53 UTC
Location: Denmark

Re: Focus on file after renaming via

Post by *TvE »

@sa16
Correct - MULTIRENAME is used

@petermad
Awsome - I have now implemented your command instead, and no longer have to look at the multirename GUI - this is a much better (and >10x faster) way to obtain my goal

Thank you!
sa16
Senior Member
Senior Member
Posts: 324
Joined: 2021-09-10, 07:15 UTC

Re: Focus on file after renaming via

Post by *sa16 »

This button can be used in TC11.50, including for several files, however, if there are more than 1 files, then there may be another file under the cursor after renaming:

Code: Select all

TOTALCMD#BAR#DATA
cm_RenMov /GT="%$DATE:Y-M-D_hm% **.*"

WCMICONS.DLL,32
Post Reply