Launching External Applications

HI folks,

 

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?

 

No idea here, but a small guess though....

Does your info.plist contains this:

        PlexPluginCodePolicy
        Elevated

/Tommy

Hi dane,

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).

Anybody got any other ideas?

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.

Thanks Mike,

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.

Thanks for the suggestions!

Thanks Mike,

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()

ROTFL...And I completely forgot this:

https://forums.plex.tv/topic/88457-python-ossystem-not-working/?hl=dane22#entry513839

So sorry

Tommy

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.

Again, nothing really of worth in the log files.

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.

I'll keep hacking away and report back.

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.

Glad to hear you're making progress.

I’m trying to create a caster channel that launches Google Chrome into Netflix.com

Although the netflix bundle was created properly in my plugins folder, the launcher itself fails and reports nothing about it in my logs.


What steps did you take to get your launcher working so far?


Win7, latest pms, Plex HT.


I wrote a greasemonkey script that enables xbox controller support on Netflix, but now I need to launch it from within Home theater.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.