Is there a way to check when a script has been opened in studio?

Title pretty much says it all. I’m working on making myself a personal discord rich presence for roblox studio, and I would like it to display the current script I’m working in.

Does anyone know of any events that are available to plugins that fire events when scripts are opened/closed? Or maybe, just something that is able to determine the user’s focused window (script or workspace)

There’s a property called ActiveScript which detects the current script edited by the user, or otherwise nil if no script is being edited. I guess it doesn’t check if a script is opened/closed but more if it’s being edited, which could draw the assumption that it’s opened or otherwise closed.