Automatic Hook Scripts

Parent Previous Next

Hook Scripts


// TeXworksScript

// Title: LaTeX errors

// Description: Looks for errors in the LaTeX terminal output

// Author: Jonathan Kew & Stefan Löffler

// Version: 0.4

// Date: 2010-11-02

// Script-Type: hook

// Hook: AfterTypeset


This is the header from a script that, well does what it says above!


Hook scripts do not appear in the Script menu and have their own Tab in the Script manager.


The two main areas that change it form a standard 'Stand Alone' script that the User makes run, is that it is triggered into running by something that the TeXworks programme has just done.


Here is an example of a hook script  setSyntaxColoringMode(QString)


// Script-Type: hook


// Hook: AfterTypeset


So you really need to be careful with what you get hook scripts to do - they will just kick in when the Hook that you have specified triggers, with out any automatic question to the User.


Available hooks are at present (2010 December):—


   TeXworksLaunched


This triggers when TeXworks has completely initialise at its startup


 NewFile


Under default settings, NewFile will happen each time Tw is opened for first use .


 NewFromTemplate


 LoadFile


 AfterTypeset


At present you can only use one hook per script.

Created with the Personal Edition of HelpNDoc: Free iPhone documentation generator