Start Automator application after closing and opening Safari

I’ve written an automator application to copy the bookmarks.plist to a second folder. Then another application to copy it back from the folder to Library/Safari. I want to run the applications when opening and closing Safari. How do I do this? I’m trying to sync my bookmarks between macs. Thanks.