More work on RBScriptDocument