How to run an Applescript at shutdown

by Bjorn   Last Updated September 11, 2019 17:01 PM

I am trying to track the occurrences and duration of power outages. I have my computer(Mac High Sierra) powered by a UPS and set to shutdown when there is an outage. I have an applescript that when run prints the time and date to a text file and am able to get that to run on start up. However, I am unable to get it to work when the computer shuts down. I have tried using launchd and logout hooks to no avail. How should I go about this?

Related Questions

Updated October 11, 2015 10:00 AM

Updated October 04, 2017 23:01 PM

Updated April 25, 2015 04:00 AM

Updated July 21, 2017 21:01 PM

Updated September 13, 2017 08:01 AM