Selection after Shift+F5

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
JFreeman
Junior Member
Junior Member
Posts: 6
Joined: 2024-08-15, 11:20 UTC

Selection after Shift+F5

Post by *JFreeman »

Hello.

Is it possible to make an option to change the selection on a newly created file using Shift+F5 copy option (on that dialog, or at least as a "hidden" .ini setting)?
Now it creates new file, but the selection stays on the old file and in the directory with hundreds of files (if the new file is not "close" to the original one) it takes some time to find the newly created file.

PS: If there is that (or similar) option already and I just didn't find it yet, please tell me, where it is.

Thank you.
Fla$her
Power Member
Power Member
Posts: 2981
Joined: 2020-01-18, 04:03 UTC

Re: Selection after Shift+F5

Post by *Fla$her »

Code: Select all

TOTALCMD#BAR#DATA
cm_Edit
/CGL0T="%P" /N="%O_copy.%E"
wcmicon2.dll,62
Create a copy of the file under the cursor and move the cursor to it
Last edited by Fla$her on 2024-08-15, 15:20 UTC, edited 2 times in total.
Overquoting is evil! 👎
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Selection after Shift+F5

Post by *Stefan2 »

Hello and welcome.

JFreeman wrote: 2024-08-15, 12:21 UTC ...
Now it creates new file, but the selection stays on the old file
and in the directory with hundreds of files (if the new file is not "close" to the original one)
it takes some time to find the newly created file.
...


For that alone, you can quickly sort by date, and select the new file (and then sort by name again, if you want)
There are even keyboard shortcuts for that.





 
JFreeman
Junior Member
Junior Member
Posts: 6
Joined: 2024-08-15, 11:20 UTC

Re: Selection after Shift+F5

Post by *JFreeman »

Thank you both for your suggestions.

But unfortunately, they are not very useful in my case:

1. Button (at least I think it's a definition of a button from Fla$her) - I don't use mouse very often when working in TC, and also I'm too used to Shift+F5. Maybe I might try to create a button and assign the key shortcut Shift+F5 for it - if it's possible, but definitely not like this one, which uses cm_Edit and predefined name of a new file ("my" files are mostly binary files, sometimes xml).

2. Using a sort - new file is created with the same attributes as old one (also timestamp) - and I work sometimes with hundreds of files generated by some system, when they all have the same attributes (creation timestamps as well), so sorting by date doesn't do anything (I know about shortcuts for sorting by name/ext/date/size - Ctrl+F3-F6) and I use them often, because it's the most useful workaround I've found so far - sort by name and try to find it quickly "by looking". :)
Fla$her
Power Member
Power Member
Posts: 2981
Joined: 2020-01-18, 04:03 UTC

Re: Selection after Shift+F5

Post by *Fla$her »

JFreeman wrote: 2024-08-15, 15:02 UTCif it's possible
This can be done directly on the Misc. page (cm_Confirmation) without opening additional dialogs.
JFreeman wrote: 2024-08-15, 15:02 UTC and predefined name of a new file ("my" files are mostly binary files, sometimes xml).
Fixed to take the name with the addition "_copy".
Although there is one problem here.
Overquoting is evil! 👎
JFreeman
Junior Member
Junior Member
Posts: 6
Joined: 2024-08-15, 11:20 UTC

Re: Selection after Shift+F5

Post by *JFreeman »

Fla$her wrote: 2024-08-15, 15:21 UTCAlthough there is one problem here.
Our systems (thank god, or they creators) don't use spaces in path, so this solution is for now the best possible.
Fla$her wrote: 2024-08-15, 15:21 UTCThis can be done directly on the Misc. page (cm_Confirmation) without opening additional dialogs.
I've created in Miscelaneous page of Settings new shortcut Ctrl+Alt+F5 (other key combinations used by default operations I use sometimes) and assigned it your proposed command and parameters.

Code: Select all

cm_Edit
/CGL0T="%P" /N="%O_copy.%E"
Now my workflow is much faster - with Ctrl+Alt+F5 I create new (copy) of a file and immediately using Shift+F6 I rename it (still 2 steps, but can be done very quickly without the need of searching for a new file).
Thank you again.

PS: after some "playing" with parameters for commands in TC, now I think that adding a parameter for cm_CopySamePanel for selecting newly created file would be very useful.
Fla$her
Power Member
Power Member
Posts: 2981
Joined: 2020-01-18, 04:03 UTC

Re: Selection after Shift+F5

Post by *Fla$her »

JFreeman wrote: 2024-08-16, 07:33 UTCstill 2 steps
Add this entry to usercmd.ini:

Code: Select all

[em_CopyFile]
cmd=cm_Edit
param=/CGL0T="%P" /N="%O_copy.%E"
And replace the command for the hotkey with em_CopyFile,cm_RenameSingleFile, removing the parameters.
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Selection after Shift+F5

Post by *petermad »

The behavior was changed in TC 11.03.

Ghisler has promised to revert it to the previous behavior (where the new file was selected) and make it optional See: https://www.ghisler.ch/board/viewtopic.php?p=453685#p453685
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: Selection after Shift+F5

Post by *sa16 »

2Fla$her
The T parameter is risky to use here.
T: Instead of creating an empty file, copy a template file to the new name. By default, the user's template directory will be used. The first file in it with the same extension will be copied to the new file.
JFreeman
Junior Member
Junior Member
Posts: 6
Joined: 2024-08-15, 11:20 UTC

Re: Selection after Shift+F5

Post by *JFreeman »

petermad wrote: 2024-08-16, 09:57 UTC Ghisler has promised to revert it to the previous behavior (where the new file was selected) and make it optional See: https://www.ghisler.ch/board/viewtopic.php?p=453685#p453685
Wow, that's great news.

I wasn't sure, if it worked that way before (I've been using MAC for a while), but I definitely don't like the current behavior, so the option to turn it "my" way is highly appreciated.
JFreeman
Junior Member
Junior Member
Posts: 6
Joined: 2024-08-15, 11:20 UTC

Re: Selection after Shift+F5

Post by *JFreeman »

sa16 wrote: 2024-08-16, 10:41 UTC 2Fla$her
The T parameter is risky to use here.
T: Instead of creating an empty file, copy a template file to the new name. By default, the user's template directory will be used. The first file in it with the same extension will be copied to the new file.
You are right - I tried it now and really - it created new file with a name derived from the filename under cursor, but the content was completly different (as you said, probably from the first file of this type in a directory).

So I'll wait (a little, I hope) for the correction of that Shift+F5 functionality by the Author.
Fla$her
Power Member
Power Member
Posts: 2981
Joined: 2020-01-18, 04:03 UTC

Re: Selection after Shift+F5

Post by *Fla$her »

sa16 wrote: 2024-08-16, 10:41 UTCThe T parameter is risky to use here.
Perhaps. I don't understand at all why the author attached the logic with the first file here. What was the task?
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Selection after Shift+F5

Post by *petermad »

2JFreeman

You can try this:

Code: Select all

[em_CopyFile]
cm_Copy /G
?%QT="%P%N"
Then you can edit the file name in the TC-prompt - it is almost like using Shift+F5 - you just have to preserve T= and the quotation marks.
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
hi5
Power Member
Power Member
Posts: 637
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: Selection after Shift+F5

Post by *hi5 »

Somewhat related: What is the word on street re a update/new version of TC, alpha/beta time soon? The unexpected "moving" still catches me by surprise.
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
sa16
Senior Member
Senior Member
Posts: 324
Joined: 2021-09-10, 07:15 UTC

Re: Selection after Shift+F5

Post by *sa16 »

Button with the TCFS2 (the optional TCFS2Tools module functions are not used):

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Utils\TCFS2\TCFS2.exe
/ef "if(null("%N"), tem(`cm_List  Select file or folder!`), if(null(%E), set_ini(`%%COMMANDER_PATH%%\usercmd.ini`,em_temp,cmd,`""%%COMMANDER_EXE%%" /P /O /S /L="%P%O (2)""`), set_ini(`%%COMMANDER_PATH%%\usercmd.ini`,em_temp,cmd,`""%%COMMANDER_EXE%%" /P /O /S /L="%P%O (2).%E""`))+tem(`cm_ClearAll,cm_Copy /GBOT="%P%O (2).%E",cm_Wait 500,em_temp,cm_Wait 500,cm_RenameSingleFile`))"
wcmicons.dll,62
Copy file/folder under cursor to "name (2).ext", go to "name (2).ext" and rename it
Post Reply