My button-scripts have often been reporting errors one line below the problem line. I have managed to tie the problem down:
- Create a new button on a toolbar, set it to 'Script function' using either JScript or VBScript, and delete the example script that appears.
- Type XXX in line 1 (or any other faulty script).
- Run the script from within the script box by clicking 'Run', and an error is correctly reported in line 1.
- Click OK to save the script to the toolbar.
- Run the button by clicking on it, and an error is incorrrectly reported in line 2.