Thank you for your work, Alex. I will try that out for sure.
- - - INFO
Verwendung im Deutschen Forum:
> http://ghisler.ch/board/viewtopic.php?p=307860#307860
- - - INFO END
- - - How-to:
INSTALL:
- download the plugin archive
- store in a folder you can find later again
- go with Total Commander !!!! to that folder
- inside of Total Commander double click that downloaded archive
- you get an dialog "do you want to install" >> click [Yes]
- install to "%Commander_Path%\plugins\WDX\WinScriptsAdv_wdx" > [OK]
--- "%Commander_Path%" is your current running TC,
--- "\plugins" is the Plugins sub-folder,
--- "\WDX" is a sub folder for all WDX-plugins, its only for to have all at one place,
--- "\WinScriptsAdv_wdx" is the name for the plugin files. (you can use another folder name, even copy it to have two plugins)
- for now, just click [OK] on the following main wdx-content-plugin dialog.
This settings are stored to the wincmd.ini , see menu "Help > About" which INI is used.
You can move the folder and modify the wincmd.ini afterwards too.
------------------------------------------------------------------------------
USAGE:
Go to "\plugins\WDX\WinScriptsAdv_wdx" and read the "ReadMe.txt"
WinScriptAdv use global variable "filename" ,for full path to the current processed file or folder ("c:\myFolder" - without end slash).
Use this variable name in your script to get a path to the file or folder that your script will process.
WinScriptAdv use variables with fixed name 'content', 'content1', 'content2' ... 'content20' for to export there content to TCs plugin interface.
Note: the Name for TCs-Custom-Column is set in WinScriptsAdvs' options.ini!
------------------------------------------------------------------------------
SCRIPT:
In script use variable named "filename" to access the current processed file or folder.
In script use variable named "content" to store script result, which is later received by TCs plugin system.
Note: the Name for TCs-Custom-Column is set in WinScriptsAdvs' options.ini! (e.g.: content=ColumnOne)
Example dummy script:
Code: Select all
x = filename //current processed file from TCs file list
content = x.GetContent //example command, put information into variable named "content" for to display in TCs first Custom Column
content1 = x.GetContent //example command, put information into variable named "content1" for to display in TCs second Custom Column
content2 = x.GetContent //example command, put information into variable named "content1" for to display in TCs third Custom Column
Name of the Custom Column (to show the content of the "content"-varable) is set in options.ini, see below.
Example VBS script:
-MyScript.vbs-
Code: Select all
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set f = oFSO.OpenTextFile(filename, 1, False)
content = f.Read(1024)
f.Close
Store the script in the Script folder:
"%Commander_Path%\plugins\WDX\WinScriptsAdv_wdx\Scripts"
------------------------------------------------------------------------------
Note to the statement above in first post:
**** Fully compatible with scripts that was created for another plugin with name script_wdx (By Lev Freidin), you do not need to fix them.
Scripts for WinScriptAdv have the same format as in script_wdx - variable with name "filename" and result variables with names: content, content1, content2, ... content20 (totally 21).
Noch ein Unterschied zwischen beiden Plugins:
TODO: TRANSLATE
Beim "Script Content Plugin 0.2.0.2" wird der Inhalt der Skript-Variablen "
content"
bei der Verwendung im TC mittels der Variablen "
Result" angezeigt:
--- Im Skript "content=xyz" .- - - - - - - - - -> in TC [=script.Result]
--- Im Skript "content1=MyResult" .- - - - - -> in TC [=script.Result1]
--- Im Skript "content2=ResultOfFunction" -> in TC [=script.Result2]
Beim "WinScript Advanced"-Plugin wird der Inhalt der Skript-Variablen "
content"
bei der Verwendung im TC mittels Variablen angezeigt, welche
ihren Namen in der options.ini erhalten haben:
--- Im Skript "content = xyz" - - - - - - - - - - - - --> in options.ini "content=SpalteEins" - -- -> in TC [=winscriptsadv.SpalteEins]
--- Im Skript "content1 = MyResult" - - - - - - - - -> in options.ini "content1=ZweiteSpalte" -> in TC [=winscriptsadv.ZweiteSpalte]
--- Im Skript "content2 = ResultOfFunction" - - -> in options.ini "content2=Drittens" -- - - -> in TC [=winscriptsadv.Drittens]
------------------------------------------------------------------------------
PREPARE PLUGIN:
Open options.ini
"%Commander_Path%\plugins\WDX\WinScriptsAdv_wdx\options.ini"
Add new section:
Code: Select all
[MyScriptNameHere]
Script=MyScript.vbs
content=Title for the first column <<<Name of TCs Custom Columns
content1=My second column
content2=My third column
extensions=*
FoldersPaths=0
Go to [Script] section and add our new script to the list of ACTIVE scripts:
Code: Select all
[Script]
ActiveScripts=CheckEncoding|Signature|MyScriptNameHere
Save options.ini file.
Please also read the readMe.txt (see spoiler below)
------------------------------------------------------------------------------
PREPARE TC:
That's almost all. Now we need to add a new column(s) in TC:
1. Restart Total Commander.
2. Click right mouse button on columns and select 'Configure custom columns' from popup menu.
3. Then click "New" > "Add Column" > button "+" >> Select "winscriptadv" >> "Title of first column",
click OK button.
Wiki:
http://www.ghisler.ch/wiki/index.php/Custom_columns
------------------------------------------------------------------------------
TESTs:
On default the options.ini read as follow:
[Script]
ActiveScripts=MinutesAgo|CheckEncoding|Signature
So we set up a Custom Column for one of this scripts.
For this test we use "Signature.vbs" script, see the Scripts sub folder.
Check out the script what the variable "content" will contain as result.
Check out the options.ini on the correct script section what is the custom column header name.
Got to an folder with some files.
Right click the file list header and chose 'Configure custom columns'.
Then click "New" > Name example "script test" > "Add Column" > button "+" >> Select "winscriptadv" >> "Signature".
Here, "Signature" is the name, given in the options.ini on the "[Signature]"-section, for the first custom column.
(content=Signature)
If you get an error on selection, just click [OK] and continue on:
Code: Select all
---------------------------
error
---------------------------
Crash in plugin WinScriptsAdv.wdx:
External exception EEDFADE
---------------------------
OK Abbrechen
---------------------------
This error did not really disturb my work more than I had to click at OK.
(That crash I got on 32-bit Win7 with TC v9.21a, on Windows [Version 10.0.18363.1198] (win10-1909) with TC v9.51 I got no crash at all)
You can also write the plugin string by hand: [=winscriptsadv.Signature]
Here, "Signature" is the name, given in the options.ini on the "[Signature]"-section, for the first custom column.
(content=Signature)
In custom columns dialog click at [OK], or add another column.
Now you should see your custom column in TCs file list.
(To go back to original view, chose "Full" from the header context menu or from the View menu)
------------------------------------------------------------------------------
More to read:
FAQs: PLUGINs - Find / Installing / Removing a plugin >>> ttps://ghisler.ch/board/viewtopic.php?p=294671#p294671
FAQs: TC Plugin Add-On AddOn Externe Tools verwenden >>>>
viewtopic.php?p=342114#p342114
------------------------------------------------------------------------------
WinScript Advanced
(c) Alex Shy, 2016
Changes.txt - v.1.7 27 June, 2016
http://www.ghisler.ch/board/viewtopic.php?t=44032
==============================================================
General Info
==============================================================
WinScriptAdv content plugin runs your scripts for files and folders and displays returned
from script info into columns.
You can write your own scripts for getting any useful information from the file\folder or parse its
name, for sorting files in a desired order, for complex file renaming with Multi-Rename Tool, etc.
You can activate unlimited scripts count in one group of columns (in one panel) - they will work together.
Each script can have multiple columns (up to 21) and display info simultaneously with other scripts that
also can be with multiple columns.
Features:
* Multiple columns per one script (up to 21);
* Unlimited number of simultaneously working scripts in one group of columns;
* Custom title name for any column;
* Supported scripting languages:
VBS, (via COM interface)
JS, (via COM interface)
Python (*.py) (via COM interface)
AutoHotKey (*.ahk) (via exe parser)
PHP (*.php) (via exe parser)
AutoIt (*.au3) (via exe parser)
PowerShell (*.ps1) (via exe parser, always running)
VBS, JS and PowerShell - are languages that come with Windows (built-in), they do not required separate installation.
What script engines from listed here are fastest?
1. Engines that works via COM interface - VBS, JS, Python.
2. PowerShell - because it always running (-noexit flag)
Languages that works via exe parser are usually slower in this plugin, because for each file WinScriptAdv needs to launch and close exe parser.
Compatible with scripts that was created for another plugin with name script_wdx (By Lev Freidin),
you do not need to fix them.
Scripts for WinScriptAdv have the same format as in script_wdx - one variable with name "filename" and result
variables with names: content, content1, content2, ... content20 (so totally 21).
==============================================================
How to create a script for WinScriptAdv:
==============================================================
1. WinScriptAdv sends to global variable 'filename' (fixed name for all scripts and engines)
a full path (long, unicode) to the file or folder ("c:\myFolder" - without end slash).
Use this variable name in your script to get a path to the file or folder that your script will process.
2. Return the result(s) of the script work to the variables with name 'content', 'content1',
'content2' ... 'content20' (so totally there are 21 content variables, and the latest is "content20").
Example:
MyScript.vbs:
Dim oFSO, f
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set f = oFSO.OpenTextFile (filename, 1, False)
content = f.Read(1024)
f.Close
Ok, now we have working example of our script.
If you need more columns (var with name "content" - is the first column),
you can use "content1", "content2" etc variables in your script.
Copy that script to MyScript.vbs file, and put it in the Script folder. You can find
it in the folder where WinScriptAdv was installed.
See examples in Script folder.
==============================================================
How to add and activate a script in WinScriptAdv
==============================================================
1. Copy script file (e.g MyScript.vbs) to Script folder
2. Open options.ini
Add new section:
[MyScript]
Script=MyScript.vbs
content=Title of first column
extensions=*
FoldersPaths=0
If you have more than one "content" variable in your script, add them also:
content1=My second column
content2=My third column
5.Go to [Script] section and add our new script to the list of active scripts:
[Script]
ActiveScripts=CheckEncoding|Signature|MyScript
Save options.ini file.
Btw, You can add all scripts to ActiveScripts - it does not affect the performance,
cause script runs only if you have the corresponding visible column in TC. You can
create groups of columns (scripts) that you need, and can easily switch between these groups
with TC (click right mouse button on columns - and select another group of columns\scripts )
__________________________________________________________________
That's almost all. Now we need to add a new column(s) in TC:
1. Restart Total Commander.
2. Click right mouse button on columns and select 'Configure custom columns' from popup menu.
3. Then click "New" > "Add Column" > button "+" >> Select "winscriptadv" >> "Title of first column",
click OK button.
That's all folks! Now you see your column and script result
in front of each file.
__________________________________________________________________
==================================================================
How to add any new custom script parser (interpreter)
==================================================================
See examples in options.ini in [ExeScriptParsers] section. Ask on forum if you have some problems.
- - - Two thought:
1) my problem with "Script Content plugin" was always
the missing "configure dialog". I always had to browse
for the plugin folder for to modify the INI.
Now I simple had drag&dropped the INI to an button. Simple as that.
Perhaps I should craft a script for an button to open a new tab and
switch to the plugin folder, and also open the INI in my favorite text editor?
That plugin needs to be more easier to handle, me think, to become more accepted by real end-users.
2) it could be mentioned that we can use comments
in the scripts section to note down what that script was made for?
[MyScript]
; Comment Purpose: Demo script No. 2
Script=MyScript.vbs
...
....