// TeXworksScript
// Title: Syntax for Scripting
// Description: Colourises .js .qs .mod files
// Author: Paul A Norman
// Version: 0.3
// Date: 2010-12-20
// Script-Type: hook
// Hook: LoadFile
var fileName = TW.target.fileName;
var extPos = fileName.lastIndexOf('.') +1;
if (extPos > 0)
{
var ext = fileName.substr(extPos);
// updated 2011 07 24
switch(ext)
{
case 'html':
case 'htm':
case 'xml':
TW.target.setSyntaxColoringMode('HTML'); // make sure you have an HTML section!
break;
case 'qs':
case 'js':
case 'mod':
case 'php':
TW.target.setSyntaxColoringMode('QtScript');
break;
default:
TW.target.setSyntaxColoringMode('LaTeX');
break;
}
} //End. if (extPos > 0)
Created with the Personal Edition of HelpNDoc: Easy CHM and documentation editor