[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: petermad, Stefan2, white, Hacker

Post Reply
User avatar
funkymonk
Senior Member
Senior Member
Posts: 490
Joined: 2013-12-04, 09:56 UTC

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

Post by *funkymonk »

My suggestion on the German translation:

Code: Select all

[DEU]
1=Fehler in Autorun Plugin.
2=Fehler in Datei: %s
3=Funktion mit diesem Namen existiert bereits: %s
4=Nicht unterstützter Schalter: %s
5=Schließendes Anführungszeichen fehlt in Zeile: %s
6=Unerwartetes Anführungszeichen %s in Zeile: %s
7=Zu viele Parameter beim Aufruf von %s.
8=Ausnahmefehler während des Funktionsaufruf aufgetreten: %s
9=Funktionsname nicht gefunden: %s
10=Zu wenige Parameter beim Aufruf von %s.
11=Mindestens ein erforderlicher Parameter beim Aufruf von %s ist leer.
12=Nicht genügend Speicher für Aufruf: %s
13=Limit für das Zählen der Ereignisse vom Typ %s ist erreicht.
14=Dem Schlüsselwort "%s" muss "%s" vorangestellt werden.
15=Die dynamische Bibliothek kann nicht geladen werden: %s
16=Die dynamische Bibliothek hat keine Funktion %s.
17=Konstante oder Umgebungsvariable kann nicht neu definiert werden: %s
18=Globale Variable "%s" kann nicht mit mit dem Namen einer Umgebungsvariablen neu definiert werden.
19="If" wurde gefunden, aber "Then" fehlt.
20=Ausdruck ist nach "Then" an dieser Stelle nicht erlaubt.
21=Falscher numerischer Wert: %s
22=Datei nicht gefunden: %s
23=Ungültiger Variablenname: %s
24=Unausgeglichene Klammern im Ausdruck: %s
25=Falsche Anführungszeichen im Ausdruck: %s
26=Falsche Syntax im Ausdruck: %s
27=Falscher Parameter beim Aufruf von %s.
28=Symbol "%s" ist an dieser Stelle nicht erlaubt.
29=Include-Datei nicht gefunden: %s
30=Unbekannter Fehler beim Aufruf von %s.
31=Nicht unterstützter Typ für Registry-Schlüssel.
32=Falscher Registy-Schlüssel.
33=Falscher Wert für Registy-Schlüssel.
34=Falscher Hex-Wert: %s
35=Ungültige Variable im Ausdruck: %s
36=Variable ist nicht definiert: %s
37=Division durch Null in der Operation: %s
38=Ungültiger Variablenname "%s". Der erste Parameter für diesen Aufruf muss ein gültiger Variablenname sein.
39=Parameter "%s" der Funktion %s muss eine existierende Variable sein.
40=Ungültiger Umgebungsvariablenname: %s
41=Args() kann nur in Funktionen mit offener Parameterliste aufgerufen werden.
42=Eine Funktionsdefinition kann nicht innerhalb einer anderen Funktion, Bedingung oder Schleife liegen.
43=Funktion %s ist außerhalb von Benutzerdefinierten Funktionen nicht erlaubt.
44=Das schließende Schlüsselwort "%s" wurde nicht gefunden.
45=Maximale Rekursionstiefe in der Funktion %s wurde erreicht.
70=Die Variable "%s" ist kein Objekt.
71=Die Eigenschaft "%s" existiert nicht.
72=Die Eigenschaft "%s" ist schreibgeschützt.
73=Das Symbol "%s" hat einen anderen Typ.
74=Bereichsüberschreitung bei Eigenschaftswert "%s" mit Bezeichner "%s".
75=Die Methode "%s" existiert nicht.
76=Nicht genügend Parameter für die Methode "%s".
77=Bereichsüberschreitung bei Methodenparameter "%s".
Sometimes %s was in quotes and sometimes not. I have not changed that everywhere since I don't know what you prefer.
My suggestion is to always use "quotes" or [brackets] around %s. At least keep it consistent (also for the other languages).
User avatar
funkymonk
Senior Member
Senior Member
Posts: 490
Joined: 2013-12-04, 09:56 UTC

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

Post by *funkymonk »

Fla$her wrote: 2024-10-14, 11:25 UTC Yeah. Fixed. Help updated. The link is the same.
IsNumber looks good now.

However,

Code: Select all

MsgBox(IsNumber(0x23))  --> shows 1. ok.
MsgBox(IsNumber('0x23'))  --> shows 0. Questionable...
For me it is ok of strings in hex (bin, oct) are not recognized as numbers. But maybe it should be mentioned in the help. I guess this is also the case for IsInt, etc...
Fla$her
Power Member
Power Member
Posts: 2780
Joined: 2020-01-18, 04:03 UTC

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

Post by *Fla$her »

'x' is the text. There is an example:

Code: Select all

Num4 = IsNumber("123ABC")  # --> 0
For IsInt, it can be added later.
I also want to note that the Hex function doesn't return '0x' from the front. And the description says that it gets a string from a number. Therefore, there is no contradiction here.
funkymonk wrote: 2024-10-15, 18:55 UTC My suggestion on the German translation:
Thanks for the suggestion. Due to controversial issues, it's better to discuss these things privately (by E-mail, for example), otherwise the topic will be littered with unnecessary information.
Overquoting is evil! 👎
User avatar
funkymonk
Senior Member
Senior Member
Posts: 490
Joined: 2013-12-04, 09:56 UTC

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

Post by *funkymonk »

Fla$her wrote: 2024-10-15, 20:48 UTC
funkymonk wrote: 2024-10-15, 18:55 UTC My suggestion on the German translation:
Thanks for the suggestion. Due to controversial issues, it's better to discuss these things privately (by E-mail, for example), otherwise the topic will be littered with unnecessary information.
Sure. Just let me know if you have questions on my suggestion.
Fla$her
Power Member
Power Member
Posts: 2780
Joined: 2020-01-18, 04:03 UTC

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

Post by *Fla$her »

Of course, there are questions. But if you are also interested in improving the translation, it's worth giving (of course, not here) arguments for corrections, for example in the form of comments to the lines.
Overquoting is evil! 👎
User avatar
funkymonk
Senior Member
Senior Member
Posts: 490
Joined: 2013-12-04, 09:56 UTC

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

Post by *funkymonk »

Since "some time", there seems to be a problem with AddDialog/ModifyDialog.

Example:

Code: Select all

LoadLibrary Plugins\Autorun_ModifyDialogs.dll
AddDialog /SAVE:3 TOverWriteForm
ModifyDialogs
Not always but especially when unpacking (e.g., with internal zip) or using directory synchronization, TC simply crashes/closes once the overwrite dialog should pop up, i.e., *before* the dialog is shown (at least I cannot see it).

I have encountered this problem with TC11.03 and TC11.50b1-4 x32 dark @ Win10&11.
I cannot tell the exact autorun version for which this problem occurred for the first time. But I can try to find out if necessary.

A solution I found is to add the WAIT parameter to introduce some delay before changing the dialog position:

Code: Select all

AddDialog /SAVE:3 /WAIT:50 TOverWriteForm
However, I think this might be a bug with autorun. Is it possible that autorun tries to change/restore the position of the overwrite dialog before the dialog is visible? Maybe that causes the crash? Would it be possible to auto-delay the repositioning until the dialog is visible? Just guessing...
Fla$her
Power Member
Power Member
Posts: 2780
Joined: 2020-01-18, 04:03 UTC

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

Post by *Fla$her »

funkymonk wrote: 2024-11-06, 12:31 UTC TC11.03 and TC11.50b1-4 x32 dark @ Win10&11.
That is, this doesn't happen on TC x64 or with the standard mode?
funkymonk wrote: 2024-11-06, 12:31 UTC Would it be possible to auto-delay the repositioning until the dialog is visible?
I don't think waiting for the dialog to be rendered is the right solution for the general case.
Overquoting is evil! 👎
User avatar
funkymonk
Senior Member
Senior Member
Posts: 490
Joined: 2013-12-04, 09:56 UTC

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

Post by *funkymonk »

Fla$her wrote: 2024-11-09, 09:15 UTC
funkymonk wrote: 2024-11-06, 12:31 UTC TC11.03 and TC11.50b1-4 x32 dark @ Win10&11.
That is, this doesn't happen on TC x64 or with the standard mode?
Unfortunately I cannot enforce the error for a targeted test. However, I have used TC in light mode for just the last 2 days (with some more sync/copy than usual) and had the problem only once. It *seems* that it happens less often -- but it does happen. Still, my super short test is certainly not representative.
I cannot tell about x64 since I use TC x32 only.
Fla$her wrote: 2024-11-09, 09:15 UTC
funkymonk wrote: 2024-11-06, 12:31 UTC Would it be possible to auto-delay the repositioning until the dialog is visible?
I don't think waiting for the dialog to be rendered is the right solution for the general case.
Hm. *if* the problem is triggered by the attempt to reposition a dialog that is not yet visible, then I think it actually *is* a suitable solution for the general case to wait until the dialog is visible. But that's guessing. The developer has to know.
Fla$her
Power Member
Power Member
Posts: 2780
Joined: 2020-01-18, 04:03 UTC

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

Post by *Fla$her »

The issue is confirmed. The suggestion with a new switch will be considered if there are problems with the bug fix. Of course, the switch is not a general case.
Overquoting is evil! 👎
User avatar
funkymonk
Senior Member
Senior Member
Posts: 490
Joined: 2013-12-04, 09:56 UTC

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

Post by *funkymonk »

Ok, thank you. Looking forward...
Fla$her
Power Member
Power Member
Posts: 2780
Joined: 2020-01-18, 04:03 UTC

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

Post by *Fla$her »

funkymonk wrote: 2024-10-27, 16:27 UTC Sure. Just let me know if you have questions on my suggestion.
You were not allowed to send messages in your profile. It's necessary to select Yes:

/ Board preferences /
Users can contact me by email: ◉ Yes
Allow users to send you private messages: ◉ Yes
Overquoting is evil! 👎
Fla$her
Power Member
Power Member
Posts: 2780
Joined: 2020-01-18, 04:03 UTC

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

Post by *Fla$her »

funkymonk wrote: 2024-11-13, 20:35 UTC Looking forward...
yahuu wrote: 2024-11-14, 15:18 UTC What exactly do you mean by "necessary functionality"?
Autorun 2.2.15.1 beta
List of changes (from bottom to top)
- fixed incorrect operation of the true branch of a ternary operator in assignment
+ Runtime: GetSelectedItems added
- the For..Next loop variable could not be changed from inside the loop
+ added compilation date to GetState output for libraries
* removed unnecessary line breaks in GetState
- fixed escaping quotes in string values in expressions
- fixed work with calculated strings in parameters for RegisterCommand, RunThread
* Tweaks: added /CM ((CSMA, SHA, SMA) switch for compatibility
* Tweaks: changed the work with calculated strings in the parameters of the called function (CSMA, SHA, SMA)
+ Runtime: added identifiers 11001-11012 to RequestInfo
+ Process: ProcessExecGetOutput can receive output in a given encoding
+ Process: functions ProcessGetPath, ProcessGetId
+ Process: a number of functions can accept not only the process name, but also the PID
- "error 3" has been fixed for Plugin when only the ANSI version of ContentGetValue is available
+ Runtime: added WinFromPoint, WinGetPID, WinGetHandleByPID, MouseSetPos
- Tweaks: SetHintParam changed the font size when the parameter name did not exist
- Runtime: fixed cutting long text in parameters
- ModifyDialog: fixed crash in some situations
+ the ShellExec function returns the PID of the running process to EXTENDED
+ Runtime: added getting rectangle boundaries in the GetCurrentItem function
- Runtime: WinGetText/WinSetText did not work with controls in another application
+ Tweaks: X, Y parameters added to ShowPopupMenu
+ Tweaks: a flag for the location of the menu near the current object in the active panel has been added to ShowPopupMenu

+ to GetState function added ability to get a list of environment variables
+ experimental: method for calculating And/Or using a "short circuit"
* minor parser optimizations
+ added ternary operator ?:
+ added a parameter to MsgBox to control appearance and behavior
- attempt to fix unstable error messages on x64
+ API: for the plugin function it is possible to increase the buffer upon request
+ added compound assignment operators: +=, -=, *=, /=, &=
- Runtime: fixes in WinGetState error values
+ added preliminary versions of Chinese translation and help (thanks to "Party")
Check it out, gentlemen. Also, in addition to getting acquainted with the new functionality in the help, I advise you to look into the "Sample Library (alpha)" section.
Last edited by Fla$her on 2024-12-05, 12:45 UTC, edited 1 time in total.
Overquoting is evil! 👎
User avatar
yahuu
Member
Member
Posts: 112
Joined: 2015-01-15, 03:19 UTC

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

Post by *yahuu »

👍
License #301983 (2016)
TC 11.03 32+64bit on 10 (21H2) 64bit, 'Everything' 1.5.0.1385a
Autorun 2.2.14.1
User avatar
funkymonk
Senior Member
Senior Member
Posts: 490
Joined: 2013-12-04, 09:56 UTC

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

Post by *funkymonk »

Great. I will check during the weekend.
User avatar
funkymonk
Senior Member
Senior Member
Posts: 490
Joined: 2013-12-04, 09:56 UTC

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

Post by *funkymonk »

The last weeks were very busy, and only now I could finally find the time to briefly check some of the new features:

Code: Select all

2.2.15 beta
+ Runtime: GetSelectedItems added
+ Process: functions ProcessGetPath, ProcessGetId
+ Runtime: added WinFromPoint, WinGetPID, WinHandleOfPID, MouseSetPos
+ Tweaks: X, Y parameters added to ShowPopupMenu
+ Tweaks: a flag for the location of the menu on the selected object has been added to ShowPopupMenu
+ added ternary operator ?:
+ added a parameter to MsgBox to control appearance and behavior
+ added compound assignment operators: +=, -=, *=, /=, &=
Apart from the last two items, I don't have Autorun scripts that make heavy use of the other features. Thus, I only did some artificial testing.
So far, everything looks good and I could not find any problem.

Regarding

Code: Select all

- ModifyDialog: fixed crash in some situations
I guess this refers to viewtopic.php?t=32427&start=150#p463275, right?
I will do some testing into that direction...

I have to change some details in my scrips anyways and will report more findings once they appear.

In any case, the new features are great and very helpful! Thank you!
Post Reply