Page 2 of 2

Re: Keyboard shortcut for inserting date when editing file names

Posted: 2024-02-18, 12:39 UTC
by TvE
Hmm... I see that there is an SHIFT+F4 shortcut which is calling this command:
cm_EditNewFile 2931 Create+Open new text file

I am not able to see [1] that this command can be called with other arguments than `1´ (which suppresses the edit).

So my question is if it's somehow possible to utilize `cm_EditNewFile´ to obtain my "create filename with current Date/DateTime prepended mapped to a keyboard shortcut?

My objective - just to make it perfectly clear - is to be able to use a keyboard shortcut to create a new txt file and open it for editing file with the current Date/DateTime prepended to the filename.

My above two comments show what I have achieved so far - which is >95% of what I want, BUT as I am now exploring the great options(!) for extending TCM with custom functionality I am getting greedy and want to do more :D

If I can get the `cm_EditNewFile´ to help me I can optimize my workflow from two steps to one (50% improvement), for an action that is in the top 10 of my TCM interaction :P

[1] https://www.ghisler.ch/wiki/index.php?title=List_of_internal_commands

Re: Keyboard shortcut for inserting date when editing file names

Posted: 2024-02-19, 02:36 UTC
by petermad
2TvE
You can not do what you wish for with cm_EditNewFile, but you can do it with cm_Edit.

Go to the Misc section of the Configuration dialog and remap Shift+F4 to either of these two setings:

https://tcmd.madsenworld.dk/editnewfilewdate1.png
or
https://tcmd.madsenworld.dk/editnewfilewdate2.png

Remember to click the green check mark

Or go to the [Shortcuts] section of your wincmd.ini file ( cd %COMMANDER_INI% ) and add these lines:

Code: Select all

S+F4=cm_Edit
S+F4_params=/CN="<[Y]-[M]-[D]_[h].[m].[s]_[N].[E]"
or these:

Code: Select all

S+F4=cm_Edit
S+F4_params=/CN="%|$DATE:Y-M-D_h.m.s|_%Q%N"
You can of course choose to remap to other keys than Shift+F4, and you can change the order of Y, M and D to reflect your locale (D-M-Y for Danish)

Re: Keyboard shortcut for inserting date when editing file names

Posted: 2024-02-19, 05:13 UTC
by sa16
You can also add the key G:

Code: Select all

/GCN="<[Y]-[M]-[D]_[h].[m].[s]_%Q%N"
/GCN="%|$DATE:Y-M-D_h.m.s|_%Q%N"

Re: Keyboard shortcut for inserting date when editing file names

Posted: 2024-02-21, 21:46 UTC
by TvE
2petermad PS.: Jeg har sendt dig en fin hilsen i din gæstebog her den anden dag
Tak for det danske tip, men jeg er mere til ISO-8601 format, så det bliver

Code: Select all

[Y]-[M]-[D]_[h][m][s]_[N].[E]
And now back to english :D

2sa16 Please enlighten me regarding `the G key´
I see that `%Q%N´ populates the dialog with the selected filename+extension - very usefull! - (but I was not able to find the documentation regarding these variables - which source have I missed?)

Re: Keyboard shortcut for inserting date when editing file names

Posted: 2024-02-21, 22:28 UTC
by ghisler(Author)
The parameters for cm_edit are described on the help page "Dialog box: Choose command".
You can get this page for example via
- right click on a button - change - click on magnifying glass symbol - F1
or
Type cm_commandbrowser in the command line - Enter - F1.

Re: Keyboard shortcut for inserting date when editing file names

Posted: 2024-02-21, 23:49 UTC
by petermad
2TvE
Jeg så din hilsen i min Gæstebog - tak for det.

If you want to open that help page frequently, you can go directly to the page with this button:

Code: Select all

TOTALCMD#BAR#DATA
hh.exe %COMMANDER_PATH%\TOTALCMD.CHM::dlg_choosecommand.htm

C:\windows\hh.exe
Open Help for Choose Commands (cm_commands with parameters)

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".

Documentation for parameters as for example %Q%N can be seen when you right-click on a button in the button bar and choose "Change" and then press F1

Direct link to Button bar help:

Code: Select all

TOTALCMD#BAR#DATA
hh.exe %COMMANDER_PATH%\TOTALCMD.CHM::dlg_configbuttonbar.htm

C:\windows\hh.exe
Open Help for Change buton bar

0
-1

Re: Keyboard shortcut for inserting date when editing file names

Posted: 2024-02-22, 10:40 UTC
by sa16
2TvE
In the TC11.03, you can already:

Code: Select all

/GCN="<[Y]-[M]-[D]_[h].[m].[s]_[A]"

Re: Keyboard shortcut for inserting date when editing file names

Posted: 2024-02-25, 11:26 UTC
by TvE
Where are the MultiRenameTool's SavedSettings persisted in the configuration files?

In my_history.ini I can find
- the RenameMask (without the name I saved it with) in the [RenameTemplates] section
- the Name as well as the RenameMask in the [rename] section
BUT the latter does not map 1:1 to the settings I have saved (it both contain more listings as well as multiple versions of same setting, like a history list

Objective: How to manipulate config files to add predefined MultiFileRename settings...

Re: Keyboard shortcut for inserting date when editing file names

Posted: 2024-02-25, 11:48 UTC
by Dalai
TvE wrote: 2024-02-25, 11:26 UTCWhere are the MultiRenameTool's SavedSettings persisted in the configuration files?
[...]
BUT the latter does not map 1:1 to the settings I have saved (it both contain more listings as well as multiple versions of same setting, like a history list
It's not a history list. The section [Rename] saves the rename profiles, each of them having a name, extension, search and replace, and parameters which are more or less a 1:1 mapping to the checkboxes like E, RegEx and so on.
Objective: How to manipulate config files to add predefined MultiFileRename settings...
Easy. Add them via the GUI and then copy the lines from wincmd.ini. One could write them from scratch but I'd do that only if I liked pain ;).

Regards
Dalai