Using Chronosync to back up to a NAS there is an option to run a post sync script when the back up is completed to shut down the Mac. The script suggested was very simple
tell application "System Events"
delay 200
shut down
end tell
I increased the delay to 200 to allow Chronosync to send emails following synchronisation from the suggested delay of 5. This works fine, the only problem is the next time the Mac is booted up the script runs again and the Mac ultimately shuts down unless shutdown is prevented by Force Quitting the App. ``Is there something simple that can be added to the script to prevent it running at boot up. If the Mac is shut down and then restarted during the day the script does not run.`