"Your Script Name" Would like to access your calendar. Stopping script

I have a number of scripts that I use to automate my office. I want them to run automatically. I am running Mavericks 10.9.4.

I have code signed my scripts to make them not trigger the accessibility security problem.

I have another problem in that they seem to randomly trigger security alerts such as “this script” would like to access your calendar. And a similar one warning that this script would like to access your contacts. I click the okay button and they work. When I check security and privacy settings they show as being authorized under the calendar’s access. I don’t see them showing up under the contacts privacy settings. My understanding is that once you click these as okay there’s most to stay clicked. They repeatedly and sometimes randomly pop up and halt the execution of my scripts. Any insight into this problem would be greatly appreciated.

I’m thinking that my problem is that my script is retaining its variables after closing. So that the OS is thinking that this is a different application. Because I’ve signed the application it is not asking if it has permission to run it’s only asking for access to contacts and calendars.

Can someone help me change this script so that it does not save the values of my variables.

You can change the script’s main.scpt file’s permissions using chmod a-w on the command line.