I have a password management application (KeePassX) of which backup I sync over Dropbox across several computers.
However the password database can be open only on one computer at a time for file locking reasons. Problems arise when one computer goes to sleep and the application is left open on this computer, the database locks are never removed and in the worst case there are unsaved changes in the database.
Would it be possible to make a program to prompt closure on sleep (like with shutdown) or record a macro which closes the program when the computer puts itself to sleep or is made sleep through Apple menu?