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

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

Post by *Ovg » 2016-05-21, 05:17 UTC

2Psychedelic
Alex, Thank you very much! Great job! It is working fine.
You save my life :mrgreen:
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-06-09, 22:18 UTC

Updated
v1.6 10 June, 2016
***
Added PowerShell scripting language support

____________________________________________

PowerShell.exe needs some time to start before first use, usually near 3-6 seconds. So in the first 3-6 seconds (after starting Totalcmd) columns will be empty.
PowerShell.exe is starting only once and remains running until you close WinScriptAdv.

You can speed up powershell startup (in general, not only in WinScriptAdv) if you run script below in PowerScript console once.

Before : powershell.exe is starting near 5 seconds
After : powershell.exe is starting near 1.5 seconds

PS script:

Code: Select all

$env:path = [Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()
[AppDomain]::CurrentDomain.GetAssemblies() | % {
  if (! $_.location) {continue}
  $Name = Split-Path $_.location -leaf
  Write-Host -ForegroundColor Yellow "NGENing : $Name"
  ngen install $_.location | % {"`t$_"}
}
Source

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

Post by *Stefan2 » 2016-06-11, 15:56 UTC

Thanks Alex, I will try. But bad timing with current released TC9b1, not much spare time this days :wink:





 
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-06-27, 16:11 UTC

Updated

v.1.7
***
Script unification, for scripts that work directly with an exe interpreter - AHK, PHP, Autoit:
Now you do not need to print values of "content" variables to the console stdOut from your script code. (Plugin will generate and add these strings).
So delete this strings from the end of your scripts (btw plugin also will work correctly if you do not delete that code).

***
Added 2 new params for ExeScriptParsers section:
StdOutFormat and CmdArgs
E.g.:
au3=c:\Program Files (x86)\AutoIt3\AutoIt3.exe
au3CmdArgs=ExeArgs
au3StdOutFormat=ConsoleWrite ($%s & @CRLF)
Read info in options.ini


Now you can use VBS in portable versions of Total Commander:

options.ini:

Code: Select all

; This VBS interpreter is only for example, WinScriptadv uses vbs\js\python engines via COM that is much faster than this.
; You can use it in portable versions of Total commander or if WSH is broken in Windows. 
;vbs=%WINDIR%\system32\cscript.exe
;vbsCmdArgs=//nologo
;vbsVarFormat=filename="%s"
;vbsDoubleSlashPath=0
;vbsStdOutFormat=Wscript.echo %s

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

Post by *Psychedelic » 2016-09-01, 14:44 UTC

Added WinScriptAdv source code.

User avatar
ZoSTeR
Power Member
Power Member
Posts: 920
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR » 2016-09-04, 10:34 UTC

I've read your source code comments about the problem of redirecting StdIn to PowerShell.

To avoid all the redirecting and sending keystrokes you can call PowerShell with a small .Net host application that uses the PowerShell .Net class.

See Writing a Windows PowerShell Host Application and also here and here for example.

This allows you to reuse the PowerShell instance and even asynchronous execution (don't know if that is feasible).

billiebub
Member
Member
Posts: 179
Joined: 2011-04-12, 19:49 UTC

plugin crashes when selecting plugin properties

Post by *billiebub » 2016-10-11, 17:54 UTC

When I select the plugin properties, a crash occurs. See image below

Image: https://ibin.co/2y7v9hTvnFEL.png

dschordsch
Junior Member
Junior Member
Posts: 18
Joined: 2015-12-04, 15:05 UTC

Post by *dschordsch » 2016-10-14, 14:04 UTC

Hi, thats a nice Plugin.

I have a question:

How does that work with the Python scripts? How does the plugin read the contents of the content variables? (And how does it send the filename variable?) The script contains no COM related stuff. Does the plugin preparse the files for lines starting with contentx ???

I know nothing about COM, so maybe my question is stupid, sorry in that case.

qxxx
New Member
New Member
Posts: 1
Joined: 2016-10-20, 10:37 UTC

Post by *qxxx » 2016-10-20, 10:42 UTC

Hi and thank you for this cool plugin.

I tried that PHP script.
It is not working for me. The column shows only "echo $content" it is not being parsed.

I tried with different php versions. PHP 5.4, 5.6 and 7.
php 5.6 and 7 is not showing anything, the column is empty.

Do I have to enable something in php.ini?

Thanks.

dschordsch
Junior Member
Junior Member
Posts: 18
Joined: 2015-12-04, 15:05 UTC

Post by *dschordsch » 2016-10-21, 14:55 UTC

qxxx wrote:The column shows only "echo $content" it is not being parsed.

I tried with different php versions. PHP 5.4, 5.6 and 7.
php 5.6 and 7 is not showing anything, the column is empty.
Have you changed that script? i ran into problems (under python) when i added spaces in front of the contentx variables.

eg

Code: Select all

f = open(filename, 'r', encoding="utf-8")
content = f.readline()
f.close()
works, but

Code: Select all

with open('testPython.py', 'r', encoding="utf-8") as f:
    content = f.readline()
works not.

i dont have PHP installed, so i can not test it.

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

Re: plugin crashes when selecting plugin properties

Post by *Ovg » 2017-01-18, 07:46 UTC

billiebub wrote:When I select the plugin properties, a crash occurs.
The same here. Both version of TC 9.0a are affected.
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

HastaLuego
New Member
New Member
Posts: 1
Joined: 2017-05-13, 09:58 UTC

Post by *HastaLuego » 2017-05-13, 10:08 UTC

A terrible mishap is with POWERSHELL encoding. Tried everything possble. It has the habit of giving output in unicode, so then when I appoint a output variable a string

$content="Ян Синклер. Введение в цифровую звукотехнику. 1990.djvu"

And that's what I got in column output.

СџВ­ вЂ˜РЃВ­Р„В«ТђР°. ‚ўҐ¤Ґ­ЁҐ Сћ жЁда®ўго §ўгЄ®вҐе­ЁЄг. 1990.djvu

User avatar
thomasmolover
Member
Member
Posts: 104
Joined: 2016-12-12, 01:32 UTC

Post by *thomasmolover » 2017-12-20, 16:59 UTC

i like this plugins and try to translate it to CHN langrage with content in file options.ini & readme to ReadMe_CN.txt

I upload the file into GDrive

here

https://drive.google.com/file/d/1tlLW8cEpgd-o2-Q4QbeTl9mBgkwaw1ie/view?usp=sharing

thomasmo
Junior Member
Junior Member
Posts: 60
Joined: 2013-11-04, 01:31 UTC

Post by *thomasmo » 2018-01-27, 18:31 UTC

if the plugins read many file, the script must read file one by one, so it would spend a long time, could the plugins sent a file list (or array) to script var, let the script collect the file info in one process?

Post Reply