This forum uses cookies. Click X button to hide this message. What is stored? / Privacy
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[wdx] WinScript Advanced Content Plugin (x86\x64) (new)
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Total Commander Forum Index -> Plugins and addons: devel.+support (English) Printable version
View previous topic :: View next topic  
Author Message
Psychedelic
Junior Member
Junior Member


Joined: 30 Oct 2011
Posts: 20

PostPosted: Thu May 12, 2016 9:00 pm    Post subject: [wdx] WinScript Advanced Content Plugin (x86\x64) (new) Reply with quote

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
[img]https://drive.google.com/file/d/0B3YBFQ1XOyUXMUpzR0FBR1E5NXM/view[/img]


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 Mon Jun 27, 2016 10:02 am; edited 22 times in total
Back to top
View user's profile Send private message
Stefan2
Power Member
Power Member


Joined: 13 Sep 2007
Posts: 1927
Location: Europa

PostPosted: Fri May 13, 2016 1:02 am    Post subject: WinScript Advanced Content Plugin (Deutsch) Reply with quote

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



 
_________________
The destination is one thing. Getting there is everything.


Last edited by Stefan2 on Wed May 18, 2016 1:49 am; edited 1 time in total
Back to top
View user's profile Send private message
Ovg
Power Member
Power Member


Joined: 06 Jan 2014
Posts: 532
Location: MOW

PostPosted: Fri May 13, 2016 2:27 am    Post subject: Reply with quote

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.20 RC1 x64, Windows 7 SP1 x64
Back to top
View user's profile Send private message Send e-mail
Psychedelic
Junior Member
Junior Member


Joined: 30 Oct 2011
Posts: 20

PostPosted: Fri May 13, 2016 6:35 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Stefan2
Power Member
Power Member


Joined: 13 Sep 2007
Posts: 1927
Location: Europa

PostPosted: Fri May 13, 2016 8:30 am    Post subject: Reply with quote

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 Very Happy



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

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


 
_________________
The destination is one thing. Getting there is everything.
Back to top
View user's profile Send private message
Psychedelic
Junior Member
Junior Member


Joined: 30 Oct 2011
Posts: 20

PostPosted: Fri May 13, 2016 9:08 am    Post subject: Reply with quote

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).
Back to top
View user's profile Send private message
Psychedelic
Junior Member
Junior Member


Joined: 30 Oct 2011
Posts: 20

PostPosted: Fri May 13, 2016 7:23 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
hi5
Member
Member


Joined: 03 Nov 2012
Posts: 155

PostPosted: Sat May 14, 2016 6:16 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Skif_off
Member
Member


Joined: 30 Sep 2013
Posts: 107

PostPosted: Sat May 14, 2016 10:30 am    Post subject: Reply with quote

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).
Back to top
View user's profile Send private message
Psychedelic
Junior Member
Junior Member


Joined: 30 Oct 2011
Posts: 20

PostPosted: Sat May 14, 2016 7:08 pm    Post subject: Reply with quote

Updated:
1.1.3: 15 May, 2016
***
Added Python scripting language support. Very Happy
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)
Back to top
View user's profile Send private message
hi5
Member
Member


Joined: 03 Nov 2012
Posts: 155

PostPosted: Sun May 15, 2016 2:12 am    Post subject: Reply with quote

Thanks for adding the Python example Smile

@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:
[testAHK]
Script=AutoHotkey.vbs
content=AutoHotkey
extensions=*
FoldersPaths=0

vbs
Code:
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:
; AutoHotkey script for testing purpose
FileReadLine, content, %1%, 1
FileAppend, %content%, *
Back to top
View user's profile Send private message Visit poster's website
Skif_off
Member
Member


Joined: 30 Sep 2013
Posts: 107

PostPosted: Sun May 15, 2016 4:31 am    Post subject: Reply with quote

2hi5
AutoHotkey.vbs
Code:
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:
[Script]
ActiveScripts=MinutesAgo|CheckEncoding|Signature|testAHK
...
[testAHK]
Script=AutoHotkey.vbs
content=AutoHotkey
extensions=txt|ini|vbs|js|ahk
FoldersPaths=0
Back to top
View user's profile Send private message
hi5
Member
Member


Joined: 03 Nov 2012
Posts: 155

PostPosted: Sun May 15, 2016 5:01 am    Post subject: Reply with quote

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

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:
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 Tue May 17, 2016 3:38 pm; edited 4 times in total
Back to top
View user's profile Send private message Visit poster's website
Skif_off
Member
Member


Joined: 30 Sep 2013
Posts: 107

PostPosted: Sun May 15, 2016 6:46 am    Post subject: Reply with quote

2hi5
I forgot that .Exec method can uses environment variables: "path TC\Plugins..." >>> "%COMMAMDER_PATH%\Plugins...". Is more beautiful Smile
Back to top
View user's profile Send private message
hi5
Member
Member


Joined: 03 Nov 2012
Posts: 155

PostPosted: Sun May 15, 2016 7:01 am    Post subject: Reply with quote

@Skif_off: Indeed, tested and it works. Updated the HOW TO above with %COMMANDER_PATH% Smile
_________________
F4MiniMenu - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey) - TC Forum thread
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Plugins and addons: devel.+support (English) All times are GMT - 6 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Imprint/Impressum: This site is maintained by Ghisler Software GmbH
Privacy Policy | Datenschutzerklärung | Politique de Confidentialité

Using phpBB © phpBB Group