New FileSystem plugin - ScriptWFX 1.0

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
Sir_SiLvA
Power Member
Power Member
Posts: 3381
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

SanskritFritz wrote:2Sir_SiLvA
:lol: first you show yourself as a total ignorant, then it turns out you are a programmer ;-)
Where Did I show ignorance?
I just said said in imhuo it would be nice if the rss-script would be 100%-full-featured
(all I said was that I dislike VB[Script]) :-)
Hoecker sie sind raus!
Sven
Member
Member
Posts: 111
Joined: 2003-02-10, 21:32 UTC
Location: Varel, Germany
Contact:

Post by *Sven »

Sir_SiLvA wrote:Is there nothing like try...execept...end in delphi in vbscript?
Insert "On Error Resume Next" as the first line in each function.

It seems that TC replaces all invalid chars to "_", but not the quotation marks. Maybe Christian can replace the quotation marks too in one of the next versions.

I found some typos in the code, please replace all "strTest" with "strText". :oops:
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

I found some typos in the code, please replace all "strTest" with "strText".
You can edit your posting and correct it.

Icfu
This account is for sale
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

You can edit your posting and correct it.
This is the way people do it in the AutoHotkey forum: a script posted in a new thread, then all modifications are done by editing the first post, and announcing it by a new post in the thread. This way you ensure that only one instance of the script exist in the thread, and the last version. I think it is a good idea. Of course, others cannot modify your post, so they make suggestions, and you act upon their input.
I switched to Linux, bye and thanks for all the fish!
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3381
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

Thx Sven works like a charm!
No Prob Bro I myself haven't seen the "test"'s :)


now as we have a rss-read-adbility inside tc we strongly
need multi-sort for colums! :-)
Hoecker sie sind raus!
Sven
Member
Member
Posts: 111
Joined: 2003-02-10, 21:32 UTC
Location: Varel, Germany
Contact:

Post by *Sven »

icfu wrote:
I found some typos in the code, please replace all "strTest" with "strText".
You can edit your posting and correct it.
Icfu
Done, but I can't edit Sir_SiLvA's local RSS_Feed.vbs. ;)
ricobautsch
Member
Member
Posts: 103
Joined: 2005-06-21, 00:42 UTC

Post by *ricobautsch »

@Sir_SiLvA
Loading the RSSDoc in the global section is not the best idea. This way the RSS will be loaded every time ScriptWFX loads your script, and it will do it also for example when listing the scripts to extract the icon for the script.
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3381
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

ricobautsch wrote:@Sir_SiLvA
Loading the RSSDoc in the global section is not the best idea. This way the RSS will be loaded every time ScriptWFX loads your script, and it will do it also for example when listing the scripts to extract the icon for the script.
but where should i put the line
Set RSSDoc = LoadDOMDocument("http://ghisler.ch/board/rss.php")
so that the doc is only loaded once ?
(PS: does anyknow know a online vbscript-kurs?)
Hoecker sie sind raus!
ricobautsch
Member
Member
Posts: 103
Joined: 2005-06-21, 00:42 UTC

Post by *ricobautsch »

@Sir_SiLvA
The right place for loading the RSSDoc is the FsFindFiles function.
This function is called when TC asks for the files to show, also for example if you press F2 (Refresh). And a refresh should really reload the data, isn't it? 8)

In the global section (outside of any function) you should only declare the variable "RSSDoc", so you can use this variable in FsGetFile, FsExecuteFile, ... without the need of loading again.
To declare the variable insert the following line:
Dim RSSDoc

Sadly i don't know an online VBScript course. But maybe Google will help you.


@All script writers
Attention
If you modify my example scripts, please do it in a copy of the sample file. Otherwise your modified files will be overridden if you install a new version of my plugin.


@All script writers
Would you like to debug your scripts?
Would you like to update your Windows Scripting Runtimes (not yet WinXP) to use the latest features of VBScript?
Do you need a documentation for VBScript and other Windows Script related stuff?

All this and more you can download for free in the Microsoft Windows Script Downloads


How to: Debugging your scripts

1. Download and install the Microsoft Script Debugger
2. Enable Debugging in the Registry
- Goto Key HKCU\Software\Microsoft\Windows Script\Settings
- Set JITDebug to 1
3. Insert a "Stop" statement in your script, where you would start
debugging.
If code execution reaches your Stop, it will stop execution and start the
debugger

Have fun 8)
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3381
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

ricobautsch wrote:@Sir_SiLvA
The right place for loading the RSSDoc is the FsFindFiles function.
This function is called when TC asks for the files to show, also for example if you press F2 (Refresh). And a refresh should really reload the data, isn't it? 8)
So, I tried it this way but this way all the Script doest it crashing TC :-(
I moved the line Set RSSDoc = LoadDOMDocument("http://ghisler.ch/board/rss.php")
into the function Function FsFindFiles(ByVal Path)
my ScriptWFX.ini looks like this

Code: Select all

[Scripts]
Path = 
Script = RSS_Feed.vbs
Timeout = 30000
my TC.Ini-Entry:

Code: Select all

[FileSystemPlugins]
TC-RSS=%Commander_Path%\PlugIns\FileSystem\Script\ScriptWFX.wfx
What am I doin wrong ? :roll:
Hoecker sie sind raus!
ricobautsch
Member
Member
Posts: 103
Joined: 2005-06-21, 00:42 UTC

Post by *ricobautsch »

@Sir_SiLvA
I see you want the RSS script the only one using with ScriptWFX. :wink:

ScriptWFX crashes TC because you have removed the Path value in the ScriptWFX.ini. This value is NOT optional, even if you want to work with only one script. Set it to a relative path based on your ScriptWFX.wfx-path or to an absolute path, pointing to your RSS_Feed.vbs.

Following version of ScriptWFX will not crash TC in this situation, instead show an error message telling you what's wrong.

Please, rename your RSS_Feed.vbs. If there will be next version of ScriptWFX and you install it, then the TC installation will override your modified script with my sample (except of course, you are using a different subfolder than "Scripts" for your modified scripts).
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3381
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

ricobautsch wrote:@Sir_SiLvA
I see you want the RSS script the only one using with ScriptWFX. :wink:
Yep, so I can check the TCFeed when I'm somewhere else...
(sorry Im to unexperience with VB to see any other usefull stuff I can do with your script :))
ScriptWFX crashes TC because you have removed the Path value in the ScriptWFX.ini. This value is NOT optional, even if you want to work with only one script. Set it to a relative path based on your ScriptWFX.wfx-path or to an absolute path, pointing to your RSS_Feed.vbs.
mh... the only entry that worked without crashing TC
Path = D:\Programme\TotalCmd\PlugIns\FileSystem\Script
even
Path = %Commander_Path%\PlugIns\FileSystem\Script
crashes TC...
Please, rename your RSS_Feed.vbs. If there will be next version of ScriptWFX and you install it, then the TC installation will override your modified script with my sample (except of course, you are using a different subfolder than "Scripts" for your modified scripts).
Sorry but Im now DAU I know what Im doin' :P
Hoecker sie sind raus!
ricobautsch
Member
Member
Posts: 103
Joined: 2005-06-21, 00:42 UTC

Post by *ricobautsch »

mh... the only entry that worked without crashing TC
Path = D:\Programme\TotalCmd\PlugIns\FileSystem\Script
You have given the absolute Path to the script. That's ok and works.

Another option (and in my opinion the better one) is to give a relative path from folder where scriptwfx.wfx resides.
I assume you have your script in the same folder as the ScriptWFX.wfx. In this case, the value "." (point, without the quotes) is a correct value for Path.

%Commander_Path% is an TC's internal folder-placeholder and AFAIK only TC itself can translate it.
You can only use systemwide placeholders like %systemroot% or %programfiles%.
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3381
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

ricobautsch wrote:<snip> In this case, the value "." (point, without the quotes) is a correct value for Path.
:oops: forgot the point and only tried \ :oops:
ricobautsch wrote: %Commander_Path% is an TC's internal folder-placeholder and AFAIK only TC itself can translate it.
You can only use systemwide placeholders like %systemroot% or %programfiles%.
Nope - 100% wrong :-)
Every PRG startet from within TC is able to check this Var, so
every TC-Plugin is able to translate this Var - if the plugin-creator supports it - TIA :-)
Hoecker sie sind raus!
Sven
Member
Member
Posts: 111
Joined: 2003-02-10, 21:32 UTC
Location: Varel, Germany
Contact:

Post by *Sven »

Sir_SiLvA wrote:(PS: does anyknow know a online vbscript-kurs?)
Information about scripting: http://www.windows-scripting.de/. :)
Post Reply