[wdx] WinScript Advanced Content Plugin (x86\x64) (new)

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

Moderators: sheep, Hacker, Stefan2, white

Psychedelic
Junior Member
Junior Member
Posts: 20
Joined: 2011-10-30, 15:35 UTC

[wdx] WinScript Advanced Content Plugin (x86\x64) (new)

Post by *Psychedelic » 2016-05-13, 03:00 UTC

WinScript Advanced
(c) Alex Shy, 2016
Download link below

WinScriptAdv content plugin runs your vbs and js scripts for files and folders and displays returned
from script info in 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.

Image: http://img10.lostpic.net/2016/05/13/c8a787207256710b7dffcf3f369fd73e.png
Image: http://img10.lostpic.net/2016/05/13/4f50f4dc13985dc5afc5ca5b1a32a30a.png
Image: https://drive.google.com/file/d/0B3YBFQ1XOyUXMUpzR0FBR1E5NXM/view


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:
  • VisualBasic Script (*.vbs)
    JavaScript (*.js)
    Python (*.py)
    AutoHotKey (*.ahk)
    PHP (*.php)
    AutoIt (*.au3)
    PowerShell (*.ps1)
* Open Source (Delphi XE8) - will be opened soon

** 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 with this plugin, because for each file WinScriptAdv needs to launch and close exe parser.

**** 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).


Useful scripts:

CheckEncoding.vbs
Returns Character Encoding and Line Endings for file. E.g: ASCII - CRLF (Win)

Signature.vbs
This script returns the first 10 bytes in the file as text or hex-representation.
Could be usefull for example to search for files with a specified signature

DayOfWeek
Showing day of week for the modified file date

Html_info
Two columns retreiving html title and "saved from" info

SearchInFile
Searches inside of a file and looks for a value specified by regular expression

ReadFileLines
Get line content from current file, from pos1 till pos2
use this info with renaming tool or for user columns

FileOwner
Returns the owner of a file \ folder

MinutesAgo
Columns Returns the difference in minutes between the current date and the date of folder\file:
E.g:
Modified:
3 min ago
or
Created
10 min ago

Suggest your own scripts!


Download:
v1.7:
http://totalcmd.net/plugring/WinScriptAdv.html

or direct link


Bugs, suggestions, new scripts, post here please.
Last edited by Psychedelic on 2016-06-27, 16:02 UTC, edited 22 times in total.

User avatar
Stefan2
Power Member
Power Member
Posts: 2626
Joined: 2007-09-13, 22:20 UTC
Location: Europa

WinScript Advanced Content Plugin (Deutsch)

Post by *Stefan2 » 2016-05-13, 07:02 UTC

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


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
...
....



 
Last edited by Stefan2 on 2016-05-18, 07:49 UTC, edited 1 time in total.
Inofficial FAQs || WIKI (Deu/Eng) || TC Home (What's new? // FAQ // Download // Order // Addons // Tools // Plugins)
Erst wenn der letzte Baum gefällt oder die letzte Biene verendet ist, werden die Leute verstehen warum Umweltschutz wichtig ist.

User avatar
Ovg
Power Member
Power Member
Posts: 598
Joined: 2014-01-06, 16:26 UTC
Location: MOW

Post by *Ovg » 2016-05-13, 08:27 UTC

Thanks! Sounds very interesting, especially pleased with the presence of x64 version and simultaneously working number of scripts.
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 9.21a x64, Windows 7 SP1 x64

Psychedelic
Junior Member
Junior Member
Posts: 20
Joined: 2011-10-30, 15:35 UTC

Post by *Psychedelic » 2016-05-13, 12:35 UTC

Stefan2 wrote: 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?
 

But you need to open options.ini once - while adding a new script(s) to the plugin.

After you have added a script to the ActiveScripts list, then you can just choose in TC what scripts (columns) or group of scripts (columns) to use.

You can add all scripts to ActiveScripts - it does not affect the performance, cause script is run only if you have the corresponding visible column in TC.
Image: http://img10.lostpic.net/2016/05/13/4f50f4dc13985dc5afc5ca5b1a32a30a.png

User avatar
Stefan2
Power Member
Power Member
Posts: 2626
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 » 2016-05-13, 14:30 UTC

Psychedelic wrote: you can just choose in TC what scripts (columns) ... to use.
You can add all scripts to ActiveScripts
Aha!

I can add all scripts to ActiveScripts,
ActiveScripts=MinutesAgo|CheckEncoding|Signature


I just have to use meaningful 'description' on the "Content=" part
[MinutesAgo]
;Columns Returns the difference in minutes between the current date and the date of folder\file:
Script=MinutesAgo.vbs
content=MinutesAgo-Created
content1=MinutesAgo-Modified
content2=MinutesAgo-Accessed

extensions=*
FoldersPaths=0



That feature in INI was missed on the original "Script Content Plugin".
There it was always "content=", "content1="... inside of the script,
then you had to modify the script.ini and set one script active.
And in TC you saw always "content", "content1", "content2" only.
And you had to check the INI always which script is currently set active.

Now being able to see real names like "MinutesAgo-Created" (Scriptname-ContentDescription) is a real improvement! Thanks!

OK, fine. I will try :D



----------------
Psychedelic wrote:After you have added a script to the ActiveScripts list,
then you can just choose in TC what scripts (columns) or group of scripts (columns) to use.
Scripts OR group of scripts?

That I have not understood yet. I will try.....


 
Inofficial FAQs || WIKI (Deu/Eng) || TC Home (What's new? // FAQ // Download // Order // Addons // Tools // Plugins)
Erst wenn der letzte Baum gefällt oder die letzte Biene verendet ist, werden die Leute verstehen warum Umweltschutz wichtig ist.

Psychedelic
Junior Member
Junior Member
Posts: 20
Joined: 2011-10-30, 15:35 UTC

Post by *Psychedelic » 2016-05-13, 15:08 UTC

Stefan2 wrote:
Psychedelic wrote:After you have added a script to the ActiveScripts list,
then you can just choose in TC what scripts (columns) or group of scripts (columns) to use.
Scripts OR group of scripts?

That I have not understood yet. I will try.....
 
Oh that's my mistake. Scripts and group of scripts are the same meaning phrases.

You can add group of scripts (= group of columns) in TC and they will display info simultaneously in one panel.

This is a group of scripts:

http://img10.lostpic.net/2016/05/13/c8a787207256710b7dffcf3f369fd73e.png

In TC we can create any groups of scripts (columns), selecting what field from plugin to show
http://img10.lostpic.net/2016/05/13/4f50f4dc13985dc5afc5ca5b1a32a30a.png

You can create another group of scripts to display, if you click right mouse button on TC columns and select "Configure Custom Column" in TC.

Then you can easily switch from one group of scripts to another from popup menu (right mouse button on TC columns).

Psychedelic
Junior Member
Junior Member
Posts: 20
Joined: 2011-10-30, 15:35 UTC

Post by *Psychedelic » 2016-05-14, 01:23 UTC

Updated:
v1.0.2:
***
Added CONTENT_DELAYIFSLOW - FT_DELAYED flag.
With this flag TC will call some functions in a background thread, so now folders is opening much faster.
***
Added comments in options.ini that describe scipts.

hi5
Member
Member
Posts: 176
Joined: 2012-11-03, 11:35 UTC
Contact:

Post by *hi5 » 2016-05-14, 12:16 UTC

Would it possible to add support for other (scripting) languages such as AutoHotkey or Python for example? (I thought it was worth asking)
F4MiniMenu - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey) - TC Forum thread

Skif_off
Member
Member
Posts: 115
Joined: 2013-09-30, 13:13 UTC

Post by *Skif_off » 2016-05-14, 16:30 UTC

2hi5
Now you can use vbs or js script for run AutoHotkey or AutoIt script and read stdout: FileAppend and ConsoleWrite (AutoIt script must be compiled as a console application and this is inconvenient).

Psychedelic
Junior Member
Junior Member
Posts: 20
Joined: 2011-10-30, 15:35 UTC

Post by *Psychedelic » 2016-05-15, 01:08 UTC

Updated:
1.1.3: 15 May, 2016
***
Added Python scripting language support. :D
Read "Python scripts - How To.txt"

Tested OK on TC+WinScriptAdv x32\x64, Windows 10 x64 Pro.

On Windows XP x64, Python + WinScriptAdv does not work. I couldn't get it to work.
hi5 wrote:Would it possible to add support for other (scripting) languages such as AutoHotkey or Python for example? (I thought it was worth asking)

hi5
Member
Member
Posts: 176
Joined: 2012-11-03, 11:35 UTC
Contact:

Post by *hi5 » 2016-05-15, 08:12 UTC

Thanks for adding the Python example :-)

@Skif_off I gave it a shot but I'm stuck it seems, the vbs part seems to generate a message "Object required: wscript" - it is probably something very obvious but can't figure out how todo it - not sure if the 2>&1 is required or not either

ini entry

Code: Select all

[testAHK]
Script=AutoHotkey.vbs
content=AutoHotkey
extensions=*
FoldersPaths=0
vbs

Code: Select all

Wscript.echo execStdOut("c:\Program Files\AutoHotkey\AutoHotkey.exe c:\totalcmd\plugins\WinScriptsAdv_wdx\Scripts\testAhk.ahk %filename% 2>&1")

Function execStdOut(cmd)
   Dim goWSH : Set goWSH = CreateObject( "WScript.Shell" )
   Dim aRet: Set aRet = goWSH.exec(cmd)
   execStdOut = aRet.StdOut.ReadAll()
End Function
ahk

Code: Select all

; AutoHotkey script for testing purpose
FileReadLine, content, %1%, 1
FileAppend, %content%, *

Skif_off
Member
Member
Posts: 115
Joined: 2013-09-30, 13:13 UTC

Post by *Skif_off » 2016-05-15, 10:31 UTC

2hi5
AutoHotkey.vbs

Code: Select all

content = execStdOut("""path AutoHotkey.exe"" ""path TC\Plugins\wdx\WinScriptsAdv\Scripts\testAhk.ahk"" """ & filename & """ 2>&1")

Function execStdOut(cmd)
   Dim goWSH : Set goWSH = CreateObject("WScript.Shell")
   Dim aRet: Set aRet = goWSH.exec(cmd)
   execStdOut = aRet.StdOut.ReadAll()
End Function
options.ini

Code: Select all

[Script]
ActiveScripts=MinutesAgo|CheckEncoding|Signature|testAHK
...
[testAHK]
Script=AutoHotkey.vbs
content=AutoHotkey
extensions=txt|ini|vbs|js|ahk
FoldersPaths=0

hi5
Member
Member
Posts: 176
Joined: 2012-11-03, 11:35 UTC
Contact:

Post by *hi5 » 2016-05-15, 11:01 UTC

@Skif_off: perfect, works like a charm - many thanks! :D

Edit: @Psychedelic - I prepared an AutoHotkey HOW TO

Edit2 (May 17th 2016): the HOW TO below no longer needed as WinScriptAdv v1.3.4 now supports AHK (and PHP) out of the box - see readme.txt for instructions


--------------------


AutoHotkey scripts - How To.txt (updated with %COMMANDER_PATH%, link to AutoIt example)

Code: Select all

WinScriptAdvanced: VBS+AutoHotkey HOW TO
Tested on Windows 7 x64.

You can use vbs or js script to run a AutoHotkey script and read stdout using the AutoHotkey FileAppend command.
(See end of file for AutoIt example)

1. First you need to have a copy of AutoHotkey.exe:
https://autohotkey.com/download/

Either install it or use one of the Portable packages.
Take note of the folder where AutoHotkey is installed or unpacked.
(see "path-to-\" below)

2. Use a VBS script to call a AutoHotkey script and read its stdout

Create these two files in your WinScriptsAdv\Scripts\ folder

2a. AutoHotkey.vbs:

Make sure you add the full path to AutoHotkey.exe (see path-to-\) and 
double check the path to your "WinScriptsAdv\scripts" folder as well in
the VBS below

' --------------
content = execStdOut("""path-to-\AutoHotkey.exe"" ""%COMMANDER_PATH%\Plugins\wdx\WinScriptsAdv\Scripts\testAhk.ahk"" """ & filename & """")

Function execStdOut(cmd)
   Dim goWSH : Set goWSH = CreateObject("WScript.Shell")
   Dim aRet: Set aRet = goWSH.exec(cmd)
   execStdOut = aRet.StdOut.ReadAll()
End Function
' --------------

2a. testAHK.AHK:

; AutoHotkey script for testing purpose
FileReadLine, content, %1%, 1
FileAppend, %content%, *

3. Update Options INI

[Script]
ActiveScripts=MinutesAgo|CheckEncoding|Signature|testAHK
; ...
[testAHK]
Script=AutoHotkey.vbs
content=AutoHotkey
extensions=txt|ini|vbs|js|ahk
FoldersPaths=0

4. Close Total Commander and Restart

--

Hat tip: Skif_off http://www.ghisler.ch/board/viewtopic.php?p=307798#307798

AutoIt example:
http://ghisler.ch/board/viewtopic.php?p=307805#307805
Last edited by hi5 on 2016-05-17, 21:38 UTC, edited 4 times in total.

Skif_off
Member
Member
Posts: 115
Joined: 2013-09-30, 13:13 UTC

Post by *Skif_off » 2016-05-15, 12:46 UTC

2hi5
I forgot that .Exec method can uses environment variables: "path TC\Plugins..." >>> "%COMMAMDER_PATH%\Plugins...". Is more beautiful :)

hi5
Member
Member
Posts: 176
Joined: 2012-11-03, 11:35 UTC
Contact:

Post by *hi5 » 2016-05-15, 13:01 UTC

@Skif_off: Indeed, tested and it works. Updated the HOW TO above with %COMMANDER_PATH% :-)
F4MiniMenu - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey) - TC Forum thread

Post Reply