ScriptWFX 1.1
Moderators: Hacker, petermad, Stefan2, white
-
- Member
- Posts: 103
- Joined: 2005-06-21, 00:42 UTC
ScriptWFX 1.1
I have released version 1.1 of ScriptWFX.
It contains some minor enhancements and bugfixes. See section History in the help file.
Download
It contains some minor enhancements and bugfixes. See section History in the help file.
Download
* The Helpfile has been UpdatedNew Enhanced RSS_Feed.vbs sample script. Now supports FsGetFile and FsExecuteFile.
New Path parameter in ScriptWFX.ini now supports environment-variables, also for example %COMMANDER_PATH%
Fix Show error message, if Script could not be loaded
Fix Empty parameter for Path in ScriptWFX.ini now means Path of ScriptWFX.wfx
New New object "plugin" with properties "VersionHigh", "VersionLow" and "ScriptFileName"
Fix The second parameter in FsGetFile (LocalName) and FsPutFile (RemoteName) was not passed by reference
* ScriptWFX is now compressed with UPX
Hoecker sie sind raus!
-
- Member
- Posts: 103
- Joined: 2005-06-21, 00:42 UTC
-
- Member
- Posts: 103
- Joined: 2005-06-21, 00:42 UTC
script template
Because of a user question i have created a template script with all supported plugin functions.
Download template.vbs
Remark:
If you want to store this file in your scripts folder, you can prevent ScriptWFX listing it in the pluginroot by changing the files extension or set the file attribute hidden.
Download template.vbs
Remark:
If you want to store this file in your scripts folder, you can prevent ScriptWFX listing it in the pluginroot by changing the files extension or set the file attribute hidden.
I put together a little script for your nice plugin that bascially is a mod of the Filesystem.vbs example and creates some kind of "virtual" file system.
Today I discovered that the script fails when I enter a dir with single files bigger than 2,147,483,648 bytes (wich is 2GB).
My assumption is that the File.Size property of your script engine is of type CLng. Is this fixable by script or in your plugin? Would certainly be nice ;)
I must say, I really like the plugin. I'm trying to stop using VBScript though and would rather like to use RubyScript. Maybe you could add support for it?
You can find RubyScript here.
So long,
Kyle K.[/url]
Today I discovered that the script fails when I enter a dir with single files bigger than 2,147,483,648 bytes (wich is 2GB).
My assumption is that the File.Size property of your script engine is of type CLng. Is this fixable by script or in your plugin? Would certainly be nice ;)
I must say, I really like the plugin. I'm trying to stop using VBScript though and would rather like to use RubyScript. Maybe you could add support for it?
You can find RubyScript here.
So long,
Kyle K.[/url]
-
- Member
- Posts: 103
- Joined: 2005-06-21, 00:42 UTC
Fixed
@KyleK
Nice to read for me, that this plugin is usefull for me, and others too. Thanx.
You are right, the ScriptFile.Size property has a wrong datatype in my plugin. I have fixed this. New version with this fix is 1.11.
Download
Of course, i could add support for other scripting languages, but the most common problem is, that these languages has no support for plugin-essential things like reference parameters.
I don't know something about RubyScript, but as far as i could read in the last minutes the problem with the non-existence of reference parameters is also the case with RubyScript. Please correct me, if i'm wrong.
Nice to read for me, that this plugin is usefull for me, and others too. Thanx.
You are right, the ScriptFile.Size property has a wrong datatype in my plugin. I have fixed this. New version with this fix is 1.11.
Download
Of course, i could add support for other scripting languages, but the most common problem is, that these languages has no support for plugin-essential things like reference parameters.
I don't know something about RubyScript, but as far as i could read in the last minutes the problem with the non-existence of reference parameters is also the case with RubyScript. Please correct me, if i'm wrong.
Thanks for the fix, works like a charm :]
About the problem with reference parameters: I'm not yet very deep into Ruby, so I needed to do a little digging on the internet. Apparently in Ruby, all variables and objects are reference variables/objects. But: The assignment character ('=') creates copies of them. I also found in a Ruby FAQ this sentence:
It seems to confirm your findings.
However, Ruby does support multiple return values:
Result:
pre: x = 1, y = 2
post: x = 2, y = 1
Not sure if this can be of help for you. There probably are other ways to deal with that (e.g. Singleton methods in classes), question is if it's worth the effort ;)
This link might be of interest to you as well.
So long,
Kyle K.
About the problem with reference parameters: I'm not yet very deep into Ruby, so I needed to do a little digging on the internet. Apparently in Ruby, all variables and objects are reference variables/objects. But: The assignment character ('=') creates copies of them. I also found in a Ruby FAQ this sentence:
There is no equivalent of other language's pass-by-reference semantics. (Link)
It seems to confirm your findings.
However, Ruby does support multiple return values:
Code: Select all
def swap(a, b)
a,b = b, a
end
x = 1
y = 2
puts "pre: x = #{x}, y = #{y}"
x,y = swap(x, y)
puts "post: x = #{x}, y = #{y}"
pre: x = 1, y = 2
post: x = 2, y = 1
Not sure if this can be of help for you. There probably are other ways to deal with that (e.g. Singleton methods in classes), question is if it's worth the effort ;)
This link might be of interest to you as well.
So long,
Kyle K.
-
- Member
- Posts: 103
- Joined: 2005-06-21, 00:42 UTC
parameter passing and other problems with RubyScript
I had already read about multiple return values, bindings and the other features supported by Ruby. But the most needed for my plugin, passing parameters by reference, is not supported.
Ruby would need another semantic plugin-implementation for parameter-exchange between the plugin and the script.
However, i have installed Ruby, modified my plugin to read Ruby-scripts, and tried to get Ruby-scripts running with my plugin. I could not test the parameter problem, because there was a problem prior to calling script-functions. It seems that the Ruby engine does not support some Interfaces needed for the scripting host to get some code-metrics, for example a procedure collection within a module.
All over, i would say it's in principle possible to support Ruby, but it would be a lot of work and include compromises for the plugins native language, VBScript.
Why are you trying to stop using VBScript?
What are the advantages of Ruby over VBScript?
Ruby would need another semantic plugin-implementation for parameter-exchange between the plugin and the script.
However, i have installed Ruby, modified my plugin to read Ruby-scripts, and tried to get Ruby-scripts running with my plugin. I could not test the parameter problem, because there was a problem prior to calling script-functions. It seems that the Ruby engine does not support some Interfaces needed for the scripting host to get some code-metrics, for example a procedure collection within a module.
All over, i would say it's in principle possible to support Ruby, but it would be a lot of work and include compromises for the plugins native language, VBScript.
Why are you trying to stop using VBScript?
What are the advantages of Ruby over VBScript?
I've been scripting in VBScript for quite a while (the IRC clientI use has VBScript support among other languages), so it's not a big deal, I know what to do.
I recently discovered Ruby though and find it much easier to work with personally. I especially like the fact that it's completely object-oriented and everything is an object by definition. It has also some nice "tricks" that make writing little scripts easier in my opinion.
But anyway, if the interface isn't there don't bother with it anymore. It's not that important and honestly, I'm currently out of ideas for what to script for TCmd ;)
Thanks for investigating though.
I recently discovered Ruby though and find it much easier to work with personally. I especially like the fact that it's completely object-oriented and everything is an object by definition. It has also some nice "tricks" that make writing little scripts easier in my opinion.
But anyway, if the interface isn't there don't bother with it anymore. It's not that important and honestly, I'm currently out of ideas for what to script for TCmd ;)
Thanks for investigating though.
Hi,
me again ;)
I have a bit of a problem with one of the properties of the ScriptFiles Object.
I want to check if a specific item already exists as an object within the ScriptFiles collection (in my case, I don't want to have the same file/folder name twice in the list).
In your help file you write:
This code gives an error: (on the line "if Files = nothing then")
I also tried this:
Here, IsObject never fails (it is always true, even if there is already an item named f.Name.
What am I doing wrong, or: How can I check properly if Script.Item(..) returns NOTHING?[/code]
me again ;)
I have a bit of a problem with one of the properties of the ScriptFiles Object.
I want to check if a specific item already exists as an object within the ScriptFiles collection (in my case, I don't want to have the same file/folder name twice in the list).
In your help file you write:
I then tried this:If Index is text, this property returns the ScriptFile where property name is this index. Example: Item("file1.txt") returns the item with property Name = file1.txt. If there is no item with this name in the Collection, the return-value will be NOTHING.
Code: Select all
Set Files = ScriptFiles.Item(f.Name)
if Files = nothing then
' do something
end if
...
Code: Select all
Error: 91
Description: Object variable not set
I also tried this:
Code: Select all
Set Files = ScriptFiles.Item(f.Name)
if IsObject(File) then
' do something
end if
What am I doing wrong, or: How can I check properly if Script.Item(..) returns NOTHING?[/code]
-
- Member
- Posts: 103
- Joined: 2005-06-21, 00:42 UTC
Look at this simple script. It's working and adds the file "file_NOT_found.txt".
Consider to declare variables with DIM, if your script contains the "OPTION EXPLICIT" statement.
If nothing helps, you can post your whole script, so i can find the problem.
ricobautsch
Code: Select all
Function FsFindFiles(ByVal Path)
Set FoundFile = ScriptFiles.Item("will_not_be_found.txt")
if FoundFile is Nothing then
ScriptFiles.Add("file_NOT_found.txt")
else
ScriptFiles.Add("file_found.txt")
end if
FsFindFiles = True
End Function
Consider to declare variables with DIM, if your script contains the "OPTION EXPLICIT" statement.
If nothing helps, you can post your whole script, so i can find the problem.
ricobautsch
I discovered the other day that ScriptWFX has problems with file sizes larger than 4GB. This becomes problematic when copying something from the script results. I often use Shift-Alt-Enter to determin the file sizes of directories, but ScriptWFX will return wrong values.KyleK wrote:I put together a little script for your nice plugin that bascially is a mod of the Filesystem.vbs example and creates some kind of "virtual" file system.
Today I discovered that the script fails when I enter a dir with single files bigger than 2,147,483,648 bytes (wich is 2GB).
My assumption is that the File.Size property of your script engine is of type CLng. Is this fixable by script or in your plugin? Would certainly be nice ;)
Could you please take a look and see if you can fix it?
Thanks.