Force Quit an App with Hazel/AppleScript/Shell Script

Hello everybody,
I have a Mac at home which runs TeamViewer. Sometimes the program crashes but doesn't close.
I would need to Force Quit it, but as the program itself is the remote program to control my second Mac, I can not force quit it. I would like to use Hazel and Dropbox to do so.
In my dropbox folder I have a random file with a random name. But if I change the name to i.e. "QuitTeamViewer" Hazel should run a script which Force Quit the App TeamViewer.
I got some help and actually this script should do the trick:
do shell script "killall TeamViewer"
So I made the rule with AppleScript like:
If there is a file with the name "QuitTeamViewer" - run AppleScript with code 'do shell script "killall TeamViewer"'
But it doesn't work.
Does anybody has an idea. I have not worked properly with AppleScript nor Shell Scripts, so I don't even know if I embeded it correctly.
Thank you in advance.
I have a Mac at home which runs TeamViewer. Sometimes the program crashes but doesn't close.
I would need to Force Quit it, but as the program itself is the remote program to control my second Mac, I can not force quit it. I would like to use Hazel and Dropbox to do so.
In my dropbox folder I have a random file with a random name. But if I change the name to i.e. "QuitTeamViewer" Hazel should run a script which Force Quit the App TeamViewer.
I got some help and actually this script should do the trick:
do shell script "killall TeamViewer"
So I made the rule with AppleScript like:
If there is a file with the name "QuitTeamViewer" - run AppleScript with code 'do shell script "killall TeamViewer"'
But it doesn't work.
Does anybody has an idea. I have not worked properly with AppleScript nor Shell Scripts, so I don't even know if I embeded it correctly.
Thank you in advance.