vbscriptnotepad++hta

Maintain VBS colors for HTA in Notepad++


I've got an HTA that uses a VBS script.

When I save the file as .hta though all the format coloring for my VBS script turns white.

Does anyone know a way to make it so NPP will recognize both languages and format the style coloring accordingly? It's nuts that the bulk of my script has no color formatting simply because it's wrapped in something else.


Solution

  • As a .HTA can contain more than one script language (even at the same time) and Notepad++'s syntax highlighting seems to be triggered by extension only (no special syntax switching markup; evidence), I would tend to associate .HTA with HTML and move all code to external files (src attribute of the script tag).

    What I wouldn't do (to much work for little gain and risk of failure), is to experiment with combining the Style Configuration for HTML and VBS (Javascript/JScript, Perl, ...) into a new Style and associate that with .HTA.

    Addition:

    My prefered editor - Komodo (since 5.2) - allows to specify the 'language' for individual files; so I can switch syntax highlighting for mixed language sources on the fly.