The code is recognized as a script, certainly due to this line :

Code:
#property show_inputs
Which is only for scripts and that you should remove.