Is there a clock plugin?

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

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

Post by *tuska »

Thank you for your hints and clarification of format.

Kind regards,
Karl
Gruß,
Karl
User avatar
tuska
Power Member
Power Member
Posts: 3755
Joined: 2007-05-21, 12:17 UTC

TC versions-No.

Post by *tuska »

Hi,
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
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
User avatar
Stefan2
Power Member
Power Member
Posts: 4153
Joined: 2007-09-13, 22:20 UTC
Location: Europa

AHK: set TC Title line with bit version date time

Post by *Stefan2 »

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
Try this:

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.
User avatar
tuska
Power Member
Power Member
Posts: 3755
Joined: 2007-05-21, 12:17 UTC

Post by *tuska »

2Stefan2

I am deeply impressed - works perfectly!
Thanks a lot!

Kind regards,
Karl
tosbsas
Senior Member
Senior Member
Posts: 428
Joined: 2003-12-19, 13:12 UTC
Location: Lima, Perú
Contact:

Post by *tosbsas »

looks awesome - but I am lost. How do I run this script?
A New Generation transformed by the Power of God
User avatar
Stefan2
Power Member
Power Member
Posts: 4153
Joined: 2007-09-13, 22:20 UTC
Location: Europa

How to run AutoHotkey AHK script in TC

Post by *Stefan2 »

tosbsas wrote:looks awesome - but I am lost. How do I run this script?
I updated my post above....




HTH?
Last edited by Stefan2 on 2016-06-13, 08:10 UTC, edited 1 time in total.
tosbsas
Senior Member
Senior Member
Posts: 428
Joined: 2003-12-19, 13:12 UTC
Location: Lima, Perú
Contact:

Post by *tosbsas »

cool that worked perfect - only thing missing now is getting it to start with tc (:-))

And after minimize the title is gone again (:--((
A New Generation transformed by the Power of God
User avatar
nsp
Power Member
Power Member
Posts: 1804
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

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 start it with TC you can use the AutoRun wcx plugin.

To get time again when back from minimized, this could be a script issue..
User avatar
Stefan2
Power Member
Power Member
Posts: 4153
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

tosbsas wrote:cool that worked perfect - only thing missing now is getting it to start with tc (:-))
You could also start both apps from a batch:
Start "" Totalcmd
Start "" AutoHotkey script.ahk

And after minimize the title is gone again (:--((
Thanks for report.
I did took now a more closer look at the code and I updated my post above....

HTH? Else report back please.




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

Re: How to run AutoHotkey AHK script in TC

Post by *tuska »

2Stefan2
Stefan2 wrote:
tosbsas wrote:And after minimize the title is gone again (:--((
I updated my post above....
HTH?
For me the previous code has a nice toggle, but after updating your post and minimizing the title is gone again.

Edit:
AutoHotkey.exe - version 1.1.23.6 Unicode 64-bit

Kind regards,
Karl
User avatar
Stefan2
Power Member
Power Member
Posts: 4153
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: How to run AutoHotkey AHK script in TC

Post by *Stefan2 »

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
Sorry, I don't understand what you try to say.


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

Post by *tuska »

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
Last edited by tuska on 2016-06-13, 22:04 UTC, edited 3 times in total.
User avatar
Stefan2
Power Member
Power Member
Posts: 4153
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

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


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

Post by *tuska »

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.
Yes, I am talking about the registered user name in TC's Title bar (no problem with up-date time).
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.
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2Stefan2
Thank a lot for a cool script! :-)
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
Post Reply