Can I see if/when someone opens Messages on my Mac? I'm concerned my roommate is looking at my text messages via the Messages app on my computer. Is there a way to know if/when the Messages app is opened on the computer? Maybe a notification or email to my iPHone?
There are a number of applications which let you create macros and scripts and trigger them in various ways. I have the most experience with Keyboard Maestro, so that's what I used for the example macro below. However, as Tetsujin commented, simply password protecting your computer probably makes more sense from a security standpoint; there isn't really any reason someone else should have access to your account.