Record click action and replay via command line?
So this might be an Accessibility issue. I was able to resolve it by going to System Preferences>Security &amp; Privacy>Accessibility and then making sure Terminal had a check in the checkbox under Privacy. 

This link does a great job of explaining it. Automator in Terminal

And by the way console can be very useful in getting meaningful error messages. 

Hope this helped.