Welcome to the forum. To highlight your script as it appears on your terminal, select the entire script that you have posted then click the </> symbol above.
So, just referencing your script, there is a misspelling:
Hi, I’m the author of Automate. Thanks to Paul for solving this.
A lot of the syntax errors that you get are from one-character or other simple typos like these: unclosed parentheses/brackets, missing commas/periods/colons, and out of order keywords. It helps to use an editor that will detect these in real time (kind of like spell check in a word processor) so you can immediately have it called to your attention.