Note: I have written sample example, getting error like “Getting errors, please fix the errors in script” while running. But I have not seen any wrong over here.
Did you check out the “Problems” tab (next to “Console” and “Log Viewer”):
If there are errors in script, little red “x” icon will show.
In my experience, there are usually some ) or ] or } missing.
(Or there is too much of them)
Hmm I’ve no problems using your script. Can you post the whole full script including import statements? And also check above answer to see if there are any problems