Please edit your post to use code-tags when posting code.
I’ll move your post to the scripting forum.