/* * check_html1.bsh - a Beanshell macro to check html files with an external software using the Console plugin * Copyright (C) 2002 Saturn * v1.00 */ import console.Console; checkHTML() { String strName = buffer.getName(); String strPath = buffer.getPath(); strPath = strPath.toLowerCase(); if (!strPath.endsWith(".htm") && !strPath.endsWith(".html")) { Macros.error(view, "This is no html file."); return; } // save the buffer buffer.save(view, null); // wait for the file to be saved VFSManager.waitForRequests(); // change this to the path you need for your checker String strCheckerPath = "\\Programme\\HTMLValidator\\htmlval25.exe"; // use the console plugin to run the checker String strCmd = new String(strCheckerPath + " " + strPath); runCommandInConsole(view, "System", strCmd); // close the console if it is open manager = view.getDockableWindowManager(); if (manager.isDockableWindowVisible("console")) { manager.toggleDockableWindow("console"); } } checkHTML();