The key point in the linked answer is:
When you first load or run the LaunchAgents you will get a prompt to set the Assistive Access in System Preferences. If you already have System preferences open you will not but the Script text file will be added to the list.
You now just have to check its check box to allow it.
Step 1 is to open the security tab and allow your script app or the individual scripts permission to automate the interface.
Step 2 - profit and avoid error -1728
