Change attributes - Change date/time: an option to copy-paste there in one go.

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
beb
Power Member
Power Member
Posts: 579
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Change attributes - Change date/time: an option to copy-paste there in one go.

Post by *beb »

A lot of my use cases imply I come there having a "date time" pair already copied in the clipboard (and, more sadly, mostly in a yyyy.MM.dd HH:mm:ss like format).
Then in pure Total Commander it becomes a pain.
I have to paste data twice (into each field), to remove excessive parts in each field, and to correct the date sequence if needed.
Or maybe I just don't know how to do it properly, and a somewhat trick exists for that?
Video illustration of how it goes in that scenario:
https://i.imgur.com/v9Ou238.mp4

Luckily, I have AkelPad text editor, that has Clipboard::PasteSerial plugin/function which is activated by the Ctrl+F10 global hotkey and allows insertion of a pre-copied text into other application fields replacing delimiter(s) with tabulation(s).
I also made a script for AkelPad to quickly switch dates between yyyy.MM.dd and dd.MM.yyyy formats.
In that case, life becomes a bit easier:
I come to Total Commander "Change attributes - Change date/time" window, then select Date field contents, hit the Ctrl+F10 combination. And, voila, the date/time are there (however, I still need to prepare dd.MM.yyyy date).
Video illustration of how it goes in scenario 2:
https://i.imgur.com/SXYuSfD.mp4

Proposition/question(s):

1. Why not to have there something like that as a native Total Commander feature?
A dedicated hotkey, a special paste button, a switch to temporarily unify date and time fields, a button to invoke a unified field, or anything of that kind?

2. An option for Total Commander to recognize there both yyyy.MM.dd and dd.MM.yyyy dates at the same time?

Thank you very much.
Last edited by beb on 2024-12-24, 01:09 UTC, edited 1 time in total.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
jberry910
Junior Member
Junior Member
Posts: 28
Joined: 2010-02-08, 02:43 UTC
Location: Illinois, USA

Re: Change attributes - Change date/time: an option to copy-paste there in one go.

Post by *jberry910 »

Below is a v1 AutoHotKey script that will do as you request. It is not a native Total Commander solution; however, it might help in the interim.

It switches date format in the clipboard from yyyy.MM.dd to dd.MM.yyyy. It adds a tab character and then adds the time.
Basically it is ready to paste into the Attribute Change "date" dialog. It adds both the date and time using Ctrl+Shift+v (Hotkey can be changed to your desired hotkey).

Copy the desired date into the Windows Clipboard.
Go to Change attributes dialog, position cursor in Date field.
Press Ctrl=Shift+v
Date in correct format will be entered, tab will move cursor to Time field and time will be entered.
If all is OK, click OK in dialog.

I am not a seasoned programmer of AHK, just a hobby user. I tested it, but I recommend testing a lot more before trusting.

Code: Select all

;  Takes the date/time in the clipboard and converts the date to a new format
;  From yyyy.mm.dd to dd.mm.yyyy
;  It adds a tab between the date and time so it can be pasted into 
;  Total Commander Change Attributes dialog 

#Requires AutoHotkey v1.1.33+					
#SingleInstance	Force
_TabChar	:= A_Tab			
_Array 		:= StrSplit(Clipboard," ",,2)
_Date 		:= _Array[1]						; Date from Clipboard
_Time 		:= _Array[2]						; Time from Clipboard
_Arr 		:= StrSplit(_Date, ".")				; Split date to create new order
_DateF 		:= _Arr[3] "." _Arr[2] "." _Arr[1]  ; Date conversion

^+v::SendInput, %_DateF% %_TabChar% %_Time%		; Paste into Total Commander Change Attributes
												; Hotkey Ctrl+Shift+v	
Joe
Central Illinois, USA
Fla$her
Power Member
Power Member
Posts: 2981
Joined: 2020-01-18, 04:03 UTC

Re: Change attributes - Change date/time: an option to copy-paste there in one go.

Post by *Fla$her »

beb wrote: 2024-12-19, 14:39 UTCA lot of my use cases imply I come there having a "date time" pair already copied in the clipboard
Where exactly does such a pair come from? Why not use a source-to-receiver date transfer script right away?
Overquoting is evil! 👎
User avatar
beb
Power Member
Power Member
Posts: 579
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Change attributes - Change date/time: an option to copy-paste there in one go.

Post by *beb »

2jberry910
Thank you a lot for your time and effort.
I really appreciate it since I have no doubts there definitely will be users who will find your advice (regarding the AutoHotKey tool) useful. And that's an aim this board exists for, so we could help each other (imho).
However, as for me, in this particular case, I've already been having a 3d party solution while looking for a native one.
Cheers.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Fla$her
Power Member
Power Member
Posts: 2981
Joined: 2020-01-18, 04:03 UTC

Re: Change attributes - Change date/time: an option to copy-paste there in one go.

Post by *Fla$her »

Now on Autorun, this can be done immediately (without dialog), without resorting to resident scripts and third-party tools.
Overquoting is evil! 👎
User avatar
beb
Power Member
Power Member
Posts: 579
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Change attributes - Change date/time: an option to copy-paste there in one go.

Post by *beb »

Fla$her wrote: 2024-12-23, 23:48 UTC Where exactly does such a pair come from?
That's the right question. But the answer depends. To simplify, let's say it comes just out of my mind.

Let's say, as an extremal instance, I have a document originally dated 1941-06-22 03:30 (i.e, having the internal date/time requisites as such).
In no way I would get a file dated like that; it would rather have a time stamp of when I made a photo/scan of it, or of when I downloaded it (or in that case of a server-reported time stamp at best, if I've got the right tool to retrieve it), or whatever.
However, having a date/time saving kink I would prefer the document to be saved under the original date/time (for the sake of science, my kink, or regardless)...

Eventually, no matter for whatever reason (any of them possible), I just come to the "Change attributes - Change date/time" page with a date/time copied in the clipboard.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Fla$her
Power Member
Power Member
Posts: 2981
Joined: 2020-01-18, 04:03 UTC

Re: Change attributes - Change date/time: an option to copy-paste there in one go.

Post by *Fla$her »

beb wrote: 2024-12-24, 00:47 UTC it would rather have a time stamp of when I made a photo/scan of it, or of when I downloaded it (or in that case of a server-reported time stamp at best, if I've got the right tool to retrieve it), or whatever.
That's what I'm talking about. Logically, it's better to do this using content plugins and saved settings in order to complete the task immediately, rather than opening a dialog for this every time. Regarding DataTaken>ModificationDate, there are several topics on the forum.
beb wrote: 2024-12-24, 00:47 UTC I just come to the "Change attributes - Change date/time" page with a date/time copied in the clipboard.
Alternatively, you can bind a hotkey to OPENATTRIBUTES <settings>, where instead of the "Change date/time:" option, "Change plugin attributes:" is checked (tc | writedate | ...).
The date format is taken from the regional settings. Currently, you can combine different formats only with scripts. There are doubts that Christian would want to make a universal parser for this. But it would be nice, of course.
Overquoting is evil! 👎
Post Reply