I'm guessing this has been asked before, but I couldn't seem to find a definitive, up to date answer: Is it possible to launch external applications from Plex plug-ins?
I've tried calls to os.system("start ") and subprocess.call(), but had no joy with either. There's no error message in the logs, but nothing happens.
I must be missing something fundamental, so a detailed explanation would really help.
Is the Caster plug-in really the only current way to do this?
Thanks for the reply. I tried adding that key pair, but had the same result. No errors, but no external app (I'm just trying to launch a cmd prompt for testing purposes).
I would suggest taking a look at how "Caster" is implemented. I'm not overly familiar with it but as I understand it, the idea is to act as an application launcher.
Also, keep in mind that the code is being executed by Plex Media Server on the computer running it, which in many cases is not the same machine as the client app.
That's exactly what I've just been off and done. I installed caster and used it to create a test application launch, then had a look in the resulting code in the *.bundle directory it created. I wasn't far off in my attempts.
subprocess.Popen()
Is the magic implementation there. I've managed to get it to work on the test server I have here (which runs a Plex Media Centre client), but need to test it on my main box (running Plex Home Theatre). I'll report back when I'm done.
Good point about the app being on the server - for the purposes of this plugin, I've created a simple menu to browse and launch my steam games (or alternatively launch Steam Big Picture mode). Both Plex client and server are running on the same machine.
That's exactly what I've just been off and done. I installed caster and used it to create a test application launch, then had a look in the resulting code in the *.bundle directory it created. I wasn't far off in my attempts.
Hmm. So, I managed to get this to work when running Plex Media Centre against Plex Media Server running on the same Win 7 machine. However, the exact same plugin did not work when launching from Plex Home Theatre against Plex Media Server on the same Win 8 machine. Oddly enough, the plugin did work as expected when I used it from the Media Browser web interface on the Win 8 Media Server. From the client, nothing happened at all - just forlorn little clicks.
I'd love to offer more assistance but I don't have any useful advice. The plugin framework and Plex ecosystem aren't really geared towards to this sort of use case. You're in pretty much uncharted waters.
No worries. Seems odd that this works in one situation, but not another. It's either Win 8 or the Home Theatre client that's different. The client seems more likely at this stage, since since I can launch from the server media manager web interface just fine.
Just in case anyone stumbles across this thread, I managed to get this working with the latest version of the Plex Media Server. Once I've tidied up the mechanism a bit, I'll release version 0.1 for general consumption.
Just in case anyone stumbles across this thread, I managed to get this working with the latest version of the Plex Media Server. Once I've tidied up the mechanism a bit, I'll release version 0.1 for general consumption.