Fix script autocompletion. Refs #6710
Merge remote-tracking branch 'origin/bugfix/6710_broken_autocomplete'