A method of using python scripts to manipulate the current document in LyX.