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

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

Post by *Ovg »

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 11.01 x64, Windows 7 SP1 x64
Psychedelic
Junior Member
Junior Member
Posts: 20
Joined: 2011-10-30, 15:35 UTC

Post by *Psychedelic »

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: 4275
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

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





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

Post by *Psychedelic »

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 »

Added WinScriptAdv source code.
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1023
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

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: 187
Joined: 2011-04-12, 19:49 UTC

plugin crashes when selecting plugin properties

Post by *billiebub »

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

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






Edit by moderator, me getting the same error on 32-bit Win7 and TC_9.21a:

Code: Select all

---------------------------
error
---------------------------
Crash in plugin WinScriptsAdv.wdx:

External exception EEDFADE
---------------------------
OK   Cancel
---------------------------

I can just click [OK] and continue.
(happens twice for me on one column selction)


Also possible to type the plugin.string by hand without using the selector dialog,
like this example: [=winscriptsadv.NameOfWantedColumn]

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

Post by *dschordsch »

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 »

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 »

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: 756
Joined: 2014-01-06, 16:26 UTC

Re: plugin crashes when selecting plugin properties

Post by *Ovg »

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 11.01 x64, Windows 7 SP1 x64
HastaLuego
Junior Member
Junior Member
Posts: 2
Joined: 2017-05-13, 09:58 UTC

Post by *HastaLuego »

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: 173
Joined: 2016-12-12, 01:32 UTC

Post by *thomasmolover »

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: 81
Joined: 2013-11-04, 01:31 UTC

Post by *thomasmo »

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?
User avatar
Wojtek
Junior Member
Junior Member
Posts: 71
Joined: 2010-02-07, 11:58 UTC
Location: Germany

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

Post by *Wojtek »

Hi,
first of all I want to thank the author for this great plugin, it seems very promising.
I would like to create my own scripts. I'm mostly familiar with JS and just a little bit VBS (actually I know only VBA, but they are similar).
The problem is that I don't understand the concept of this plugin :( and the options.ini file is a bit confusing.

Is it possible to get any other information than a files properties? For example the width (in pixels) of an image file or the duration (in seconds) of an audio file?
Asus Maximus VIII Hero · Win10 Pro x64
Crucial MX500 1TB SSD · 64GB Corsair Vengeance LPX · nVidia GeForce RTX 3060 · Intel i7 7700K

Lenovo ThinkPad X1 Yoga 2.Gen · Win10 Pro x64
512GB SSD · 16GB RAM · intel HD620 · i7-7600U

TC 11.03 32-bit #347308
Post Reply