I used John Gruber's PHP Syntax Checking script as a model for this. You'll need to have Javascript Lint command line tool installed. Copy and paste the code below into your favorite AppleScript editor. Comments outline where you can customize it to suit your own coding style.
- 14 Feb 2011 - Added Licensing information. BSD or MIT
- 06 Jun 2014 - Moved to GitHub