With sincere apologies we are in fact talking VBSCRIPT sigh!!!!
I have worked on this but cannot get it working on my main script.
So I have a debugging script below (which is working but 2 things I don't understand may be relevant to my main script.
QUERY 1 Toggle Effect
(Hm I did not know I could make a header like that....)
Consider the Folder Options >> Show Filter >> File Names field.
This is blank to start with.
As expected after running the script the field for the current folder tab is not populated with "Bne Airport" as per the script.
The folder tab is now filtered so only file names containing the string are visible.
That is as expected
But when you run it again it has the effect of removing the string from the field above.
Run it again (3rd time) and the filtering effect is created again (field is populated)
Why this toggling effect?
' VBSCRIPT
'
'Option Explicit
Function OnClick(ByRef clickData)
' ---------------------------------------------------------
DOpus.ClearOutput
Set cmd = clickData.func.command
Str_Filter_ENTERED = "Bne Airport"
DOpus.Output("set SHOWFILTERFILENAME ""regex: " + Str_Filter_ENTERED + """")
cmd.RunCommand("set SHOWFILTERFILENAME ""regex:" + Str_Filter_ENTERED + """")
End Function
QUERY 2 Removing Trailing Inverted Commas have not effect
Notice below I have removed the trailing inverted commas.
i.e. the + """" has been removed
This has no effect - the script still works. Why? Maybe the set command is clever enough to close the inverted commas itself?
The toggle effect is unchanged.
'
'Option Explicit
Function OnClick(ByRef clickData)
' ---------------------------------------------------------
DOpus.ClearOutput
Set cmd = clickData.func.command
Str_Filter_ENTERED = "Bne Airport"
DOpus.Output("set SHOWFILTERFILENAME ""regex: " + Str_Filter_ENTERED)
cmd.RunCommand("set SHOWFILTERFILENAME ""regex:" + Str_Filter_ENTERED)
End Function
*IXP thank you for continued help it is greatly appreciated.
The above troubleshooting script was an attempt to zero in on the issue.
I got different results with my troubleshooting script to my main script for reasons I do not understand.
My main script pops up a dialog box in which some text can be typed in.
Upon hitting ok the current lister tab file display is filtered in a manner similar to that described above.
It works fine unless there is a space in the text.
In an effort to accommodate spaces I have added the changes highlighted in yellow in the screenshot below.
So far as I can work out that is exactly what works in my troubleshooting script above.
But it breaks my main script.
Any pointers would be greatly appreciated.
Sorry for the VB this is an old script!!
Full script is below the screenshot.....
OMG I dont think I have done that!
I am capable of confusing myself in such a way
Any new script I write I do in JScript..... generally I am taking existing scripts and editing them and hisotrically alot of those have been VBScript.
I have looked through the history of this post and I only see VBScript samples/references etc.
Am I mistaken in that?
Thanks gents
I cannot believe I did that doh!
For anyone who might be interested there are multiple ways I think to included inverted commans in a JSCRIPT string. One of which is a backslash as an escape character.
So these statements are working for me:
Opus wants " in its commands, JScript can handle both " and ' (only needs to be consistent per line, not per script). So to avoid having to escape quotes, I reserve the " for Opus and only use ' for JScript.