You are here: PSPad forum > English discussion forum > Multihighlighter and user defined highlighters

Multihighlighter and user defined highlighters

#1 Multihighlighter and user defined highlighters

Posted by: clanman | Date: 06/07/2011 13:51 | IP: IP Logged

I am in the process of creating a totally revamped VBScript user highlighter which will include many constants and common object names, properties and methods I use on a regular basis.

I would like to use this highlighter inside the Multi Highlighter so that I can use it against .WSF files.

My setup is this
Highlighter name: VBS Complete
Code explorer file type: ftVBS
Highlighter file types: *.vbs,*.wsf

Under Program Settings->Multihighlighter, I have unticked all "Open in highlighter" options and ticked <% %>.

In "For <%..%> use, I have VBS Complete.

Current action is:
If I open the file then select the actual VBS Complete highlighter, the section of the code marked as vbs is displayed as it should be using the user highlighter.

If I view the script in the multihighlighter, the HTML section of the file is displayed correctly and the VBS section is shown as what I assume to be the internal VBS key word recognition rules and not the ones from the VBS Complete definition file.

Desired outcome
Is there a way to open WSF files in the multihighlighter and have the multihlighter user the user defined language file instead of the internal one?

Options: Reply | Quote | Up ^


#2 Re: Multihighlighter and user defined highlighters

Posted by: pspad | Date: 06/18/2011 17:38 | IP: IP Logged

In program settings / Multihighlighter check:
Open files: [x]<%..%> in multihighlighter

Options: Reply | Quote | Up ^


#3 Re: Multihighlighter and user defined highlighters

Posted by: clanman | Date: 06/19/2011 07:01 | IP: IP Logged

pspad:
In program settings / Multihighlighter check:
Open files: [x]<%..%> in multihighlighter

This has been done. The problem has been confirmed that the internal vbscript and not the user defined version is being used to highlight the script.

Here is an example of the script colouring if I use my home grown script colours.

Set WshNetwork = WScript.CreateObject("WScript.Network")

Here is the same colouring if I use the same code with the internal vbscript setting. The multihighlighter with or without vbscript selected (and with/without the [x]<%..%> showing my own vbscript highlighter) shows the same outcome for the vb portion of the code.

Set WshNetwork = WScript.CreateObject("WScript.Network")

I am currently using V2417.

Options: Reply | Quote | Up ^


#4 Re: Multihighlighter and user defined highlighters

Posted by: clanman | Date: 07/19/2011 12:30 | IP: IP Logged

I have had some minor success here by putting a<%code%>around the code in the .wsf file before the<scipt language="VBScript">statement.

With this in place, the required user highlighter is used.

This however presents anouter problem in that the script engine does not recognise the<%..%>construct and errors. Is there another way to get the user highlighter to kick in?

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2014 Jan Fiala
Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák