Select all files with same date?

English support forum

Moderators: sheep, Hacker, Stefan2, white

User avatar
Stefan2
Power Member
Power Member
Posts: 2360
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Select all files with same date?

Post by *Stefan2 » 2019-02-20, 18:47 UTC

tuska wrote:
2019-02-20, 18:21 UTC
I have another request:
Karl, what is the TC-internal command to "unselect all" ?



 

User avatar
tuska
Power Member
Power Member
Posts: 1413
Joined: 2007-05-21, 12:17 UTC

Re: Select all files with same date?

Post by *tuska » 2019-02-20, 19:00 UTC

Stefan2 wrote:
2019-02-20, 18:47 UTC
tuska wrote:
2019-02-20, 18:21 UTC
I have another request:
Karl, what is the TC-internal command to "unselect all" ?
I would take
cm_ClearAllFiles=3304;Unselect all files
from TOTALCMD.INC, since folders are not supported.

I don't know where to put that in the code. 2 attempts were not successful.

User avatar
Stefan2
Power Member
Power Member
Posts: 2360
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Select all files with same date?

Post by *Stefan2 » 2019-02-20, 19:02 UTC

Answer for KarlShow
Edit, I was to quick


So try that code change on Romans' code
https://ghisler.ch/board/viewtopic.php?p=351735#p351735

Code: Select all

	PostMessage, 1075, 2033, , , ahk_class TTOTAL_CMD
		;Menu "SHOW > Only Selected Files" > cm_ShowOnlySelected=2023;Hide files which aren't selected
		PostMessage, 1075, 2023, , , ahk_class TTOTAL_CMD
			;cm_ClearAllFiles=3304;Unselect all files
			PostMessage, 1075, 3304, , , ahk_class TTOTAL_CMD
	Sleep, 1000


Modified AutoHotkey script: Select all files with same dateShow
Original script by Hacker > ;https://ghisler.ch/board/viewtopic.php?p=351735#p351735



;//Post by *Hacker » Mon Feb 18, 2019 20:54
;//Original: https://ghisler.ch/board/viewtopic.php?p=351735#p351735
;//Re: Select all files with same date?
;//TC-Button:
;// Command: "path\to\autohotkey.exe" "path\to\SameDateFileList.ahk"
;// Parameter: < use %P%N for date from selected file, or leave empty for current system date >
;// Start path:
;// Icon: "path\to\autohotkey.exe"
;// Tooltip:
;// SameDateFileList.ahk
;=================================================
FileGetTime, Date, %1%
FormatTime, Date, %Date%, yyyyMMdd
Loop, Files, *.*
SameDateFileList .= Substr(A_LoopFileTimeModified, 1, 8) = Date ? A_LoopFileName . "`n" : ""

If (SameDateFileList)
{
ClipboardBak = %ClipboardAll%
Clipboard := Substr(SameDateFileList, 1, StrLen(SameDateFileList) - 1)

;//Read file selection from clipboard
;cm_LoadSelectionFromClip=2033;Read file selection from clipboard
PostMessage, 1075, 2033, , , ahk_class TTOTAL_CMD

;//Hide files which aren't selected, show selected files only
;Menu "SHOW > Only Selected Files" > cm_ShowOnlySelected=2023
PostMessage, 1075, 2023, , , ahk_class TTOTAL_CMD

;//Unselect all files, remove the red color highlighting
;cm_ClearAllFiles=3304;Unselect all files
PostMessage, 1075, 3304, , , ahk_class TTOTAL_CMD

Sleep, 1000
Clipboard = %ClipboardBak%
}
;=================================================
;// END





AutoHotkey and Total Commander
FAQs: automate/script TC with AutoHotkey AHK
https://ghisler.ch/board/viewtopic.php?p=350976#p350976







 

User avatar
tuska
Power Member
Power Member
Posts: 1413
Joined: 2007-05-21, 12:17 UTC

Re: Select all files with same date?

Post by *tuska » 2019-02-20, 19:16 UTC

=== IN ARBEIT ===

Hi Stefan,
Thanks for the explanations - must read that later.

With this code the filtered files with red marking are shown to me in the background very briefly (split second).
After that the view is updated immediately, i.e. the filtering does not exist.

Code: Select all

FileGetTime, Date, %1%
FormatTime, Date, %Date%, yyyyMMdd
Loop, Files, *.*
	SameDateFileList .= Substr(A_LoopFileTimeModified, 1, 8) = Date ? A_LoopFileName . "`n" : ""

If (SameDateFileList)
{
	ClipboardBak = %ClipboardAll%
	Clipboard := Substr(SameDateFileList, 1, StrLen(SameDateFileList) - 1)
	PostMessage, 1075, 2033, , , ahk_class TTOTAL_CMD
	;Menu "SHOW > Only Selected Files" > cm_ShowOnlySelected=2023;Hide files which aren't selected
	PostMessage, 1075, 2023, , , ahk_class TTOTAL_CMD
		;Menu "SHOW > All Files" > cm_SrcAllFiles=312;Source: All files
		PostMessage, 1075, 312, , , ahk_class TTOTAL_CMD
	Sleep, 1000
	Clipboard = %ClipboardBak%
}
Last edited by tuska on 2019-02-20, 19:21 UTC, edited 1 time in total.

User avatar
Stefan2
Power Member
Power Member
Posts: 2360
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Select all files with same date?

Post by *Stefan2 » 2019-02-20, 19:20 UTC

tuska wrote:
2019-02-20, 19:16 UTC
After that the view is updated immediately, i.e. the filtering does not exist.
Yes, sorry, I showed you a wrong way,.... but I have already updated in post above.




 

User avatar
tuska
Power Member
Power Member
Posts: 1413
Joined: 2007-05-21, 12:17 UTC

Re: Select all files with same date?

Post by *tuska » 2019-02-20, 19:36 UTC

Hi Stefan,
Thank you very much for your efforts and explanations!

The following code works perfectly for me:
Today's files are filtered and displayed without markers ...

Code: Select all

FileGetTime, Date, %1%
FormatTime, Date, %Date%, yyyyMMdd
Loop, Files, *.*
	SameDateFileList .= Substr(A_LoopFileTimeModified, 1, 8) = Date ? A_LoopFileName . "`n" : ""

If (SameDateFileList)
{
	ClipboardBak = %ClipboardAll%
	Clipboard := Substr(SameDateFileList, 1, StrLen(SameDateFileList) - 1)
	PostMessage, 1075, 2033, , , ahk_class TTOTAL_CMD
	;Menu "SHOW > Only Selected Files" > cm_ShowOnlySelected=2023;Hide files which aren't selected
	PostMessage, 1075, 2023, , , ahk_class TTOTAL_CMD
			;cm_ClearAllFiles=3304;Unselect all files
			PostMessage, 1075, 3304, , , ahk_class TTOTAL_CMD
	Sleep, 1000
	Clipboard = %ClipboardBak%
}
At this point also many thanks to Hacker for the script!

User avatar
Hacker
Moderator
Moderator
Posts: 11156
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Select all files with same date?

Post by *Hacker » 2019-02-20, 20:40 UTC

tuska,
And to Stefan2 for his original version and help!

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.

User avatar
tuska
Power Member
Power Member
Posts: 1413
Joined: 2007-05-21, 12:17 UTC

Re: Select all files with same date?

Post by *tuska » 2019-02-20, 22:08 UTC

Hacker wrote:
2019-02-20, 20:40 UTC
tuska,
And to Stefan2 for his original version and help!

Roman
Yes, of course!
I already thanked him.

Regards,
Karl

User avatar
tuska
Power Member
Power Member
Posts: 1413
Joined: 2007-05-21, 12:17 UTC

Re: Select all files with same date? | Summary

Post by *tuska » 2019-02-21, 12:17 UTC

Here is a summary based on the AHK scripts:
(1) Mark-files-with-the-same-DATE.ahk
https://ghisler.ch/board/viewtopic.php?p=351735#p351735 (script 2 - shorter)
(2) Filter_files_with_the-same-DATE_and_display_only_these_files.ahk
https://ghisler.ch/board/viewtopic.php?p=351803#p351803
PostMessage, 1075, 2033, , , ahk_class TTOTAL_CMD
;Menu "SHOW > Only Selected Files" > cm_ShowOnlySelected=2023;Hide files which aren't selected
PostMessage, 1075, 2023, , , ahk_class TTOTAL_CMD
;cm_ClearAllFiles=3304;Unselect all files
PostMessage, 1075, 3304, , , ahk_class TTOTAL_CMD
(3) Filter_files_with_the-same-DATE_and_display_only_these_files_red-marking.ahk
https://ghisler.ch/board/viewtopic.php?p=351735#p351735
PostMessage, 1075, 2033, , , ahk_class TTOTAL_CMD
;Menu "SHOW > Only Selected Files" > cm_ShowOnlySelected=2023;Hide files which aren't selected
PostMessage, 1075, 2023, , , ahk_class TTOTAL_CMD

Code: Select all

------------------------------------------------------------------------------------------
AHK-Skript	Files		TC Button			Marking		Filtering
------------------------------------------------------------------------------------------
(1)		TODAY		Command: Path\To\xxx.ahk (1)	red		---
				Parameters: blank
				Start path: blank

(2)		TODAY		Command: Path\To\xxx.ahk (2)	---		Yes
				Parameters: blank
				Start path: blank

(3)		TODAY		Command: Path\To\xxx.ahk (3)	red		Yes
				Parameters: blank
				Start path: blank
------------------------------------------------------------------------------------------
(1)		DATE of		Command: Path\To\xxx.ahk (1)	red		---
		Cursor 		Parameters: %P%N
		position	Start path: blank
				
(2)		DATE of		Command: Path\To\xxx.ahk (2)	---		Yes
		Cursor		Parameters: %P%N
		position	Start path: blank
				
(3)		DATE of		Command: Path\To\xxx.ahk (3)	red		Yes
		Cursor		Parameters: %P%N
		position	Start path: blank
------------------------------------------------------------------------------------------
(1)	Mark-files-with-the-same-DATE.ahk
(2)	Filter_files_with_the-same-DATE_and_display_only_these_files.ahk
(3)	Filter_files_with_the-same-DATE_and_display_only_these_files_red-marking.ahk
Thanks to all!

Post Reply