corrects both script and command widgets for every document

This solves #198.