[texworks] Scripting: Share functionality between scripts

Henrik Skov Midtiby henrikmidtiby at gmail.com
Wed Jun 20 13:36:24 CEST 2012


Hi,

Until an hour ago I considered it impossible to include functionality
from one script into another.
Then I examined a test script provided by Antonio Macri [1], where
this little piece of code was found (line 60).

var file = TW.readFile("logParser.js");
if (file.status == 0) {
  eval(file.result);
  file = null;  // free mem
}

This code gives access to functionality present in the logParser.js file.
Just wanted to share this idea with the other script writers out there.

Best regards,
Henrik Skov Midtiby

[1] https://bitbucket.org/antoniomacri/texworks-logparser/src/8162fb823060/logParserTest.js


More information about the texworks mailing list