Macro to Show What Triggered an App to Open?

Is there a way to figure out what caused a particular app to open?

The issue is Safari keeps opening on its own, and I can't figure out why. I have another browser set as the system default. When I search the web for clues, the usual answer comes back to a virus. I've looked into those cases, but that doesn't seem to be the problem. Ran malware scans, etc.

Couldn't I create a macro that is triggered whenever Safari is opened, and then parse the system log to figure out what triggered it? I've tried searching the console logs and couldn't find it.

I don't think there is, unfortunately. It is unlikely that the system log would tell you anything.

If it was some kind of malware, I would expect Safari to open to some particular page of some particular scammy website.

Is it showing anything other than a blank page when it opens?

You could, of course, create a macro to quit Safari whenever it opens, but I understand that is hardly satisfying as an answer.

Another possibility is that maybe Safari is setup for some odd protocol that is being triggered.

I would try installing SwiftDefaultApps and look through its settings to see if Safari is listed anywhere.

Or you could use its command-line tool swda:

	swda getSchemes | fgrep -i Safari

and

 	swda getUTIs | fgrep -i Safari

would be two places to start.

2 Likes

:+1: Thanks @tjluoma, much appreciated. I've installed it and changed all the associations I could find. I should know within a day or so if it worked. (Also was able to fix some stubborn markdown file associations, which was a relief!)

Edit: That did the trick, thank you very much!

1 Like

I'm very pleased to hear that!