Run AppleScript Embedded Error - expected end but found on

I'm using a hazel rule to do the following. Run AppleScript with embedded script. I have his function that I call in various areas of the script.
when compiling I get "expected end but found on" error. If I don't use functions then it works. Are functions not supported in this interface in hazel or is there another way to declare these functions so that it works?
when compiling I get "expected end but found on" error. If I don't use functions then it works. Are functions not supported in this interface in hazel or is there another way to declare these functions so that it works?
- Code: Select all
on hideApp(appName)
tell application "System Events"
set visible of application process appName to false
end tell
end hideApp
hideApp(appName)