I am trying to write a plugin that will launch an external application (with parameters), possibly close Plex (if it gets in the way), wait for the external application to close, and then relaunch Plex (if I ended up having to close it). Also, while the external application is running, and want the ability to press the menu button on my remote to cleanly close the external application (not just kill it).
What are the best practices to go about something like this?
Is this the best way to do it? I’m new to OSX, Plex, Plugin Developement, AppleScript etc, and there is lots to catch up on, and I want to make sure that the choice I make isn’t a stupid one.
With apple script, is it possible to tell Plex to cleanly close, register for apple remote events, launch an app, and then tell the app to cleanly close once the apple remote menu button is pressed, and then relaunch Plex?