Is there a clock plugin?
Moderators: Hacker, petermad, Stefan2, white
TC versions-No.
Hi,
I use this script in cases of picture-uploads for TC-Forum.
Could someone please add the TC-version no. as described here:
http://ghisler.ch/board/viewtopic.php?p=242413#242413
I would appreciate if for example this would be shown in the title bar:
Total Commander (x64) 9.0ß1 - dd.MM.yyyy - HH:mm
Edit:
"TC as admin" ^ would be nice too.
Thank you in advance.
Kind regards,
Karl
I use this script in cases of picture-uploads for TC-Forum.
Code: Select all
#SingleInstance ignore
#Persistent
#NoTrayIcon
SetTimer subTimer, 500
subTimer:
if WinActive( "ahk_class TTOTAL_CMD" )
{
FormatTime, time,, dd.MM.yyyy - HH:mm
WinSetTitle Total Commander - %time%
}
Return
http://ghisler.ch/board/viewtopic.php?p=242413#242413
I would appreciate if for example this would be shown in the title bar:
Total Commander (x64) 9.0ß1 - dd.MM.yyyy - HH:mm
Edit:
"TC as admin" ^ would be nice too.
Thank you in advance.
Kind regards,
Karl
AHK: set TC Title line with bit version date time
Try this:tuska wrote:I would appreciate if for example this would be shown in the title bar:
Total Commander (x64) 9.0ß1 - dd.MM.yyyy - HH:mm
Code: Select all
#SingleInstance force
#Persistent
;#NoTrayIcon
;//Set Total Commander Title line
;//http://ghisler.ch/board/viewtopic.php?p=309256#309256
;//Version 0.004; 2016-06-13, 12:54
;//Tested with AHK (L) v1.1.22.09 ("WinGet,,ProcessPath" needs v1.1.01 or newer)
SetTimer subTimer, 60000 ; 60000 are 60 seconds update cycle.
subTimer:
hWnd := WinActive("ahk_class TTOTAL_CMD")
If (hWnd)
{
WinGet, v_TCExePath, ProcessPath, ahk_id %hWnd%
;//Get and format the Fileversion:
FileGetVersion, v_TCVersion, %v_TCExePath%
; StringLeft, vFirstDigit, v_TCVersion, 1
; if(vFirstDigit = 9){
;v_TCVersion := "v" . SubStr(v_TCVersion, 1, 1)
if(v_TCVersion = "9.0.0.0")
v_TCVersion = 9.0b1
if(v_TCVersion = "9.0.0.1")
v_TCVersion = 9.0b2
if(v_TCVersion = "9.0.0.2")
v_TCVersion = 9.0b3
;//Get the Bit Bittness Architecture:
; TOTALCMD.EXE
;TOTALCMD64.EXE
StringRight, vLastSix, v_TCExePath, 6 ; cm.exe OR 64.exe
StringLeft, vFirstTwo, vLastSix , 2 ; cm OR 64
if(vFirstTwo=64)
vBit = (x64)
else
vBit = (x86)
;//Check for Adminrights:
if(A_IsAdmin)
vAdm = ^ %A_Space%
;//Check for registered:
vKey = NOT REGISTERED
SplitPath, v_TCExePath , ,TCDir
IfExist, %TCDir%\wincmd.key
vKey =
;//Get and format the time:
FormatTime, time,, dd.MM.yyyy - HH:mm
;//Set new TC title:
WinSetTitle %vAdm%Total Commander %vBit% %v_TCVersion% - %time% %vKey%
; }
Return
}
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Change
;#NoTrayIcon
to
#NoTrayIcon
once it runs fine for you.
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Code: Select all
Run with AHK-Classic v1.0.xxx:
---------------------------
TC-TitelLeiste-Clock.ahk
---------------------------
Error: Parameter #2 invalid
Specifically: ProcessPath
---> 016: WinGet,v_TCExePath,ProcessPath,ahk_id %hWnd%
The program will exit.
---------------------------
OK
---------------------------
Solution: use newest AHK Version, at least AHK (L) v1.1.01
- - - - - - - - - - - - - - - - - - - - - - - - - - -
tosbsas wrote:looks awesome - but I am lost. How do I run this script?
- save the code as text file with AHK extension (TCTitle.ahk)
- download and install AutoHotkey (the newer version, called AutoHotkey-L, or be sure the version is like 1.1.x.x.x,
or just the newest version, but for that script not the "Classic" v1.0) https://autohotkey.com/
- double click the file TCTitle.ahk
Done
Or
- download and unpack AutoHotkey zip archive (Portable Downloads, no installer)
- run "D:\rive\path to\AutoHotkey.exe" "D:\rive\path to\TCTitle.ahk"
Done
- - -
Most of us have AutoHotkey as tool with TC
D:\rive\path to\Totalcmd\Tools\AutoHotkey\AutoHotkey.exe
D:\rive\path to\Totalcmd\Tools\AutoHotkey\TCTitle.ahk
Run from inside TC portable with relative paths like:
"%Commander_Path%\Tools\AutoHotkey\AutoHotkey.exe" "%Commander_Path%\Tools\AutoHotkey\TCTitle.ahk"
- - - - - - - - - - - - - - - - - - - - - - - - - - -
HTH?
Last edited by Stefan2 on 2016-06-13, 10:54 UTC, edited 4 times in total.
How to run AutoHotkey AHK script in TC
I updated my post above....tosbsas wrote:looks awesome - but I am lost. How do I run this script?
HTH?
Last edited by Stefan2 on 2016-06-13, 08:10 UTC, edited 1 time in total.
To start it with TC you can use the AutoRun wcx plugin.tosbsas wrote:cool that worked perfect - only thing missing now is getting it to start with tc (:-))
And after minimize the title is gone again (:--((
To get time again when back from minimized, this could be a script issue..
You could also start both apps from a batch:tosbsas wrote:cool that worked perfect - only thing missing now is getting it to start with tc (:-))
Start "" Totalcmd
Start "" AutoHotkey script.ahk
Thanks for report.And after minimize the title is gone again (:--((
I did took now a more closer look at the code and I updated my post above....
HTH? Else report back please.
Re: How to run AutoHotkey AHK script in TC
2Stefan2
Edit:
AutoHotkey.exe - version 1.1.23.6 Unicode 64-bit
Kind regards,
Karl
For me the previous code has a nice toggle, but after updating your post and minimizing the title is gone again.Stefan2 wrote:I updated my post above....tosbsas wrote:And after minimize the title is gone again (:--((
HTH?
Edit:
AutoHotkey.exe - version 1.1.23.6 Unicode 64-bit
Kind regards,
Karl
Re: How to run AutoHotkey AHK script in TC
Sorry, I don't understand what you try to say.tuska wrote:2Stefan2...
For me the previous code has a nice toggle, but after updating your post and minimizing the title is gone again.
Kind regards,
Karl
Toggle:
1) If I use ahk-file, then user is removed
2) If I minimize TC and expand it, then user is shown again
Minimizing:
With the updated code user is not removed after expanding.
That is not what tobsas want.
Edit:
SetTimer subTimer, 60000
1) If I use ahk-file, then user is removed
2) If I minimize TC and expand it, then user is shown again
SetTimer subTimer, 500
1) If I use ahk-file, then user is removed
2) If I minimize TC and expand it, then user is NOT shown again
1) If I use ahk-file, then user is removed
2) If I minimize TC and expand it, then user is shown again
Minimizing:
With the updated code user is not removed after expanding.
That is not what tobsas want.
Edit:
SetTimer subTimer, 60000
1) If I use ahk-file, then user is removed
2) If I minimize TC and expand it, then user is shown again
SetTimer subTimer, 500
1) If I use ahk-file, then user is removed
2) If I minimize TC and expand it, then user is NOT shown again
Last edited by tuska on 2016-06-13, 22:04 UTC, edited 3 times in total.
"user is removed " // "user is shown again "
Do you talk about the registered user name, shown in TC Title bar?
This script is not meant to remove the registered user name from TC Title bar, but that is an side-effect, OK I see.
I guess what you have experienced, is the slow up-date time of the script since v0.03.
I guess if you wait for an minute, "it will work again"?
If you don't want to wait that minute, modify the script
and change
SetTimer subTimer, 60000
to
SetTimer subTimer, 500
Then the timer is triggered every half of an second.
THAT?
Do you talk about the registered user name, shown in TC Title bar?
This script is not meant to remove the registered user name from TC Title bar, but that is an side-effect, OK I see.
I guess what you have experienced, is the slow up-date time of the script since v0.03.
I guess if you wait for an minute, "it will work again"?
If you don't want to wait that minute, modify the script
and change
SetTimer subTimer, 60000
to
SetTimer subTimer, 500
Then the timer is triggered every half of an second.
THAT?
Yes, I am talking about the registered user name in TC's Title bar (no problem with up-date time).Stefan2 wrote:"user is removed " // "user is shown again "
Do you talk about the registered user name, shown in TC Title bar?
This script is not meant to remove the registered user name from TC Title bar, but that is an side-effect, OK I see.
For me all is OK, but I thought you wanted reported back, if after going back from minimizing the user name furthermore should not be shown (as tobsas wanted).
Edit:
I have edited my previous post for clarifying.
http://ghisler.ch/board/viewtopic.php?p=309483#309483
Last edited by tuska on 2016-06-13, 15:24 UTC, edited 2 times in total.