[WDX] Autorun Plugin: Run commands/set envvars on TC start

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
zhxeeaa
Junior Member
Junior Member
Posts: 50
Joined: 2016-12-10, 06:21 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *zhxeeaa »

Fla$her wrote: 2022-09-01, 18:02 UTC
Hacker wrote: 2022-08-31, 19:36 UTCIt seems to me that the conversation derailed here:
Apparently so.
Hacker wrote: 2022-08-31, 19:36 UTCI was saying that I have never observed focus only being lost by switching to another window and not by minimizing.
Clearly.
Hacker wrote: 2022-08-31, 19:36 UTCFrom my experience a window always loses focus when minimized. However, it seems you misunderstood my point as me saying that I never saw a window lose focus by switching to another window.
That's exactly how I understood you. :)

2zhxeeaa
So they would write that the title should be changed. Then why check the activity? Just change in the loop:

Code: Select all

While 1
  ShellExec '%COMMANDER_PATH%\Utils\TCFS2\TCFS2.exe' '/ei "settext(`My HEADER`)"'
  Sleep 5000
Wend
zhxeeaa wrote: 2022-09-01, 12:23 UTCI think this problem is the same as the fs2 of TCFS2 that I encountered before to hide the title bar and lose the Windows TaskBar.
That's a whole other problem. See my answer below. I solved this problem a long time ago with AutoIt script for restoring the window when you move the mouse pointer to the upper left corner of the screen.
Thanks!
But compared to your solution, I feel that TCIMG is better. It will fixed the title and cannot see any flashing or changes.
I also hidden the title bar, but Taskbar still shows a long string of title, but it is not a problem now.

LoadLibrary %COMMANDER_PATH%\Addons\TCFS2\TCFS2Tools.dll
ShellExec "%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe" "/ei mm0"
shellexec "%COMMANDER_PATH%\Addons\TCIMG\TCIMG.exe" "tityn=0 title=~~~~~~~~~~~~~~~~~~~~✿~~~~𝓣𝓒~~~~✿||insystem<>"

In fact, TCIMG also has instructions to hide menu bars, but it looks like TCFS2 is better than it, so I mix these commands and use it.
Now the only shortcoming is that there will be a hidden title bar at the beginning of the TC, but this is much better than losing Taskbar.
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Fla$her »

2zhxeeaa
Why are you quoting the entire post?
It will fixed the title and cannot see any flashing or changes.
By flashing, do you mean the text change itself? If you hold down Ctrl+R, you should see. Or there is a very small delay.
You can change the delay of 5000 to something more modest (for example, 20-40), but this will not save you from 100% hiding the moment of changing the text.
If you prefer the resident execution of the utility, then instead of the plugin loop, you can use the TCFS2 loop, combining it with hiding the title bar:

Code: Select all

ShellExec '%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe' '/ei mm0 /ef "loop(settext(`MY TITLE`) && delay(5))"'
With a delay of 5 milliseconds, you should at least not see any changes to the text in the taskbar. You will most likely see it in the title bar.

The author, by the way, is not against adding a command to change the title. So later it will be possible to use her without using third-party utilities.
Last edited by Fla$her on 2022-09-07, 13:09 UTC, edited 1 time in total.
Overquoting is evil! 👎
zhxeeaa
Junior Member
Junior Member
Posts: 50
Joined: 2016-12-10, 06:21 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *zhxeeaa »

Fla$her wrote: 2022-09-02, 11:24 UTC 2zhxeeaa
Why are you quoting the entire post?
It will fixed the title and cannot see any flashing or changes.
By flashing, do you mean the text change itself? If you hold down Ctrl+R, you should see. Or there is a very small delay.
You can change the delay of 5000 to something more modest (for example, 20-40), but this will not save you from 100% hiding the moment of changing the text.
If you prefer the resident execution of the utility, then instead of the plugin loop, you can use the TCFS2 loop, combining it with hiding the title bar:

Code: Select all

ShellExec '%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe' '/ei mm0 /ef "loop(settext(`MY TITLE`) && delay(5))"'
With a delay of 5 seconds, you should at least not see any changes to the text in the taskbar. You will most likely see it in the title bar.

The author, by the way, is not against adding a command to change the title. So later it will be possible to use her without using third-party utilities.
I have tried "TitleExtraText", but It's not my purpose, I want "replace" not only "extra".
Last edited by zhxeeaa on 2022-09-02, 14:11 UTC, edited 1 time in total.
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Fla$her »

zhxeeaa wrote: 2022-09-02, 13:48 UTCI have tried "TitleExtraText", but It's not my purpose, I wan't "replace" not only "extra".
You wan't ... not only ...? Are you sure?
Explain in more detail. I don't understand. settext changes the title completely.
And stop quoting posts, please.
Overquoting is evil! 👎
zhxeeaa
Junior Member
Junior Member
Posts: 50
Joined: 2016-12-10, 06:21 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *zhxeeaa »

It's "want" not "wan't"
Sorry, I didn't check it seriously before posting. This symbol ' was added by the Google Translate "cleverly".
"TitleExtraText" at present, it is obvious that can't achieve my purpose until it can provide the function of replacing the original string.

Even if set to delay 5 seconds, I will still see the flash back when TC is opened and first clicked on taskbar, and then it will be OK.
and I have tried 5、50、500,last set to 300,
I will test for a while.
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Fla$her »

zhxeeaa wrote: 2022-09-03, 12:42 UTC until it can provide the function of replacing the original string.
What is it expressed in?
zhxeeaa wrote: 2022-09-03, 12:42 UTCEven if set to delay 5 seconds, I will still see the flash back when TC is opened and first clicked on taskbar, and then it will be OK.
and I have tried 5、50、500,last set to 300
delay(5) is 5 milliseconds, not seconds. 5 s = 5000 ms.
Overquoting is evil! 👎
zhxeeaa
Junior Member
Junior Member
Posts: 50
Joined: 2016-12-10, 06:21 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *zhxeeaa »

TitleExtraText add custom text before or after the original title text, and what I want is not to display the original text, just display my Custom text only.
I know it is milliseconds, what I wroted "seconds" is just a habitual error ...
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Fla$her »

zhxeeaa wrote: 2022-09-04, 04:43 UTCand what I want is not to display the original text, just display my Custom text only.
So I wrote:
Fla$her wrote: 2022-09-02, 14:01 UTC settext changes the title completely.
Overquoting is evil! 👎
User avatar
beb
Senior Member
Senior Member
Posts: 430
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *beb »

Since the Autorun Plugin deals with the environment variables it just would be a great thing if it could also process variables within a "classic" cmd syntax regarding extracting part of (substring)/retrieving specific characters from a string variable:
https://ss64.com/nt/syntax-substring.html
  • Syntax
    %variable:~start_index%
    %variable:~start_index,end_index%
  • This can include negative numbers:
    %variable:~start_index, -end_index%
    %variable:~-start_index,end_index%
    %variable:~-start_index,-end_index%
  • start_index Defines the starting point for the string returned, for positive numbers this is the number of characters skipped.
    A negative number will count backwards from the end of the string.
  • end_index Defines the end point for the string returned, for positive numbers this is the number of characters to return after the start_index.
    A negative number will count backwards from the end of the string.
The current plugin's implementation (implying using StrLeft StrRight StrLen StrPart StrPos StrReplace StrTrim functions) does not embrace the said classic syntax.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Fla$her »

beb wrote: 2022-11-04, 13:02 UTCdoes not embrace the said classic syntax.
In what sense does "not embrace"? These functions are sufficient for the implementation of tasks. What the cmd program supports is not at all required to support programs in VB-like syntax like AutoIt, etc. Where did the information about the "classic" syntax come from? This is just a minor aesthetic that does not affect performance improvement in any way, but on the contrary requires additional parsing.
Overquoting is evil! 👎
User avatar
beb
Senior Member
Senior Member
Posts: 430
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *beb »

2Fla$her
For instance, how would you translate that simple %commander_path:~,-2% (i.e. extract everything of %commander_path% but the last two characters)?
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Fla$her »

StrLeft(COMMANDER_PATH, StrLen(COMMANDER_PATH) - 2)
Overquoting is evil! 👎
User avatar
beb
Senior Member
Senior Member
Posts: 430
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *beb »

So setting up a simple user-defined variable I would need to use

Code: Select all

COMMANDER_USER_STR = StrLeft(%COMMANDER_PATH%, StrLen(%COMMANDER_PATH%) - 2)
SetEnv /EV COMMANDER_USER_VAR %COMMANDER_USER_STR%
instead of just

Code: Select all

SetEnv /EV COMMANDER_USER_VAR %COMMANDER_PATH:~,-2%
OK then.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Fla$her »

One line is enough here:

Code: Select all

SetEnv COMMANDER_USER_VAR %"StrLeft(COMMANDER_PATH, StrLen(COMMANDER_PATH) - 2)"
Overquoting is evil! 👎
KozakMak
Senior Member
Senior Member
Posts: 352
Joined: 2021-05-24, 12:39 UTC
Location: UA

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *KozakMak »

can i use DisableMarkedMenuItems in Start menu ?
OS: Win10 | TC: latest x64
Post Reply