Caster - An Application Launcher (inspired by AppTV)

well, I've been skrewing around with the code (I know, dangerous for someone that knows no coding), so I decided to get a new version of caster from github. Installed into plugins folder and restarted the server. Now, Caster page only comes up if I click on "recently used" in the home page, but cannot get the caster page to begin process of, picking a location, image, description. nothing happens. I cannot even get to that page if I proceed to the Channels page where all are listed alphabetically. 

In the media manager it says channel is not responding. I have the latest install of PMS and HT on a Mac.

edit: old question removed.

I created a caster which should launch steam in big picture mode, using -bigpicture didnt work so I tried creating a bat which should (it works when double clicked) 

tasklist|>nul find /i "Steam.exe"
if errorlevel 1 (
start Steam.exe -bigpicture
) else (
start Steam.exe "steam://open/bigpicture"
)

but it still just opens into steam normally without big picture.

I did some digging and it turns out steam wont update the setting, it says it set the download location and everything but it keeps creating the exact same plugin, same name, same file location, same command line. it keeps giving me a "getdirectory failed for..." whenever I try to change the location etc.

Well aparently the channel created is different, but it acts the same in every way, even when going to the settings in the channel it still says to go to the .exe, even though the defaultprefs say otherwise, when i change the settings to re-point to the bat it doesnt do anything at all.

edit: old question removed.

I created a caster which should launch steam in big picture mode, using -bigpicture didnt work so I tried creating a bat which should (it works when double clicked)

tasklist|>nul find /i "Steam.exe"if errorlevel 1 (start Steam.exe -bigpicture) else (start Steam.exe "steam://open/bigpicture")
but it still just opens into steam normally without big picture.

I did some digging and it turns out steam wont update the setting, it says it set the download location and everything but it keeps creating the exact same plugin, same name, same file location, same command line. it keeps giving me a "getdirectory failed for..." whenever I try to change the location etc.


Well aparently the channel created is different, but it acts the same in every way, even when going to the settings in the channel it still says to go to the .exe, even though the defaultprefs say otherwise, when i change the settings to re-point to the bat it doesnt do anything at all.
I had the same problem while creating some game casters. I found 2 solutions. The first is to uninstall Plex and delete the Plex media server folder located in c:/user/appdata/local (not exactly ideal I know but wasn't a big deal for me since I run a server on my htpc specifically for caster created plugins.) The second is to create the catser again but use a different title. As an example if your original catser was called 'Steam' you could simply add a period to the end 'Steam.' Anyone of these two methods should resolve the problem.

Also using the command steam://open/bigpicture with steam.exe should be all you need to launch into big picture every time. At least that's how it works for me.

Cleanup to avoid clutter for author!

Pl. check my post of how I got caster partially working on OS X!

Loving the concept of this plug-in! Thank you, been exciting.

I reached up to the point where I get the same error as mentioned in this post , csvke did you ever get the app to run?

Ok, for those on OS X and who are having a bit of trouble creating your plugin via caster. Here’s how I got the channel created since I did not find anyone sharing how they got the correct plug-ins path to work.

I downloaded the code from the “working” branch here

I then, in windows (it is easier to edit files within the caster.bundle) I navigated to caster.bundle > Contents  >  Code  > and opened the __init__.py in a text editor like EditPlus or Notepad.

I changed the following:

WIN_PLUGIN_FOLDER = 'Plug-ins/'
PLEX_SERVER_DIR = "/Users//Library/Application Support/Plex Media Server"

“” needs to be changed to your username. Restart PMS.

Now you should at least be able to create your own plugin.

------------------------------------------------------------------------------------------------------------------------------------

Nope! I get :

This channel is not responding."

after I make the changes and restart the Plex server.

Well, this time I tried it again and got it to create a Caster (via media manager only) but now I can't open it? There is a "Caster-Kylobrowser.bundle" in the Plugins section. Here are my screen shots of what it looks like.

https://www.dropbox.com/s/abdkhden845z0mp/Screenshot%202014-07-02%2023.59.20.png

https://www.dropbox.com/s/yx9htlbvakicfq1/Screenshot%202014-07-02%2023.58.35.png

But the caster will not open. when I retried doing this via HT I kept getting GET errors.

Cleanup to avoid clutter for author!

Pl. check my post of how I got caster partially working on OS X!

Yes, I get everything you show and am creating casters but they will not load once they are created.

https://www.dropbox.com/s/ruobii3he10khy9/Screenshot%202014-07-03%2002.35.12.png

https://www.dropbox.com/s/dxz2eau2nc22aaf/Screenshot%202014-07-03%2002.34.32.png

As you can see in the second photo, the icon does not show up in the corner, just the generic one does. Also if the icon is clicked it says "channel not responding.

I am showing the 2  casters I made here "Kylo Browser" and "Mac Blue-ray Player" . Neither start nor do the icons show up when you go to their start page but this is the closest i have ever gotten so thanks for your help so far.

I have the newest renditions of Plex HT, Server and OSX.

In the interest of getting caster working for everyone on OS X, wanted to share how I got it running. The “How_to_Cast_an_External_Program.doc”  by the author was sufficient, however, before you follow the steps I must warn you, I haven’t got the plugin to work as yet and patiently await the author of the code to advice.

I downloaded the code from the “working” branch here

Once you download the zip file, you will have the “Caster.bundle” inside the “Caster-working” folder, extract the “Caster.bundle”.

In windows (it is easier to edit files within the caster.bundle) I navigated to caster.bundle > Contents  >  Code  > and opened the __init__.py in a text editor like EditPlus or Notepad.

I changed the following:

WIN_PLUGIN_FOLDER = 'Plug-ins/'
PLEX_SERVER_DIR = "/Users//Library/Application Support/Plex Media Server"

“” needs to be changed to your username.

In OS X on your PMS i.e. the path for plugins should ideally be

~/Library/Application Support/Plex Media Server/Plug-ins

Copy/Paste the edited “Caster.bundle” to the folder in the path above.

Restart PMS.

Now you should be able to create your own plugin, following the instructions below.

In your local network plex client machine or PMS open up a browser and launch Plex Web, navigate to Channels. You should see the below screen, click on the gear icon shown in a red box in the below image.

Give your plugin a name and click on save as in the screenshot below

Click on the plugin itself

You should then see the following in the screenshot below, click on the “Select Applications”

Click on your applications folder to navigate to the application you’d like to launch

I Am select the “Terminal.app” which resides in the “utilities” folder within the “Applications” folder, for my needs, you could select any application.

Once selected you’ll get a brief confirmation message stating that the app has been selected, blink and you’ll miss it ; ) , click on the "Main Menu" to go back and set all other preferences for your plugin.

Click on the “select icon” to set an icon for your plugin, 512x512 pixels image should suffice, to keep your plugin neat, as the author has suggested in his “How to”, keep all your icon and image files in one folder.

Last you will click on “Create Caster” and if you’ve set the paths right (mentioned in the start of the post) your plugin should be created. Click on your plugin!

It will take you to another page, click on the Cast there too

Last you'll get this error message!


 

Ok, so although it does not work if you navigate to the path below in you PMS machine

~/Library/Logs/PMS Plugin Logs

You will find the “com.niridia..log”, open it up in text editor and you may see the lines below as mentioned in a post earlier.

Awaiting response from the author, my thought is if you chown/chmod+x "some file" via terminal

It should give python enough privileges to launch the app, however, I have not fully understood the implications this would entail hence refraining from doing so at the moment, till I hear from the dev.

I see no other way to give/elevate privileges for the app to be launched via the Caster.bundle! unless there is an App key generation and usage process like for windows or if the Caster.bundle can somehow check for permission using keychain! 8-}

I guess its something to do with "*args, **kwargs" that are passed to the app! I guess the key can't be empty! Will dig deeper!

There is a problem with the line of code below found in __init__.py on line 172 of the Caster.bundle

subprocess.Popen([str(Prefs['{runPath}']), ClearNoneString(Prefs['{runArgs}'])])

and in the plugin created via Caster.bundle the same line should appear around line 61. If they are both commented out using a "#" then the plugin created gives a success notification on execution, however nothing actually happens. The method of passing arguments to the app for windows differs in mac is my guess!



Yes, I get everything you show and am creating casters but they will not load once they are created.

https://www.dropbox.com/s/ruobii3he10khy9/Screenshot%202014-07-03%2002.35.12.png

https://www.dropbox.com/s/dxz2eau2nc22aaf/Screenshot%202014-07-03%2002.34.32.png

As you can see in the second photo, the icon does not show up in the corner, just the generic one does. Also if the icon is clicked it says "channel not responding.

I am showing the 2  casters I made here "Kylo Browser" and "Mac Blue-ray Player" . Neither start nor do the icons show up when you go to their start page but this is the closest i have ever gotten so thanks for your help so far.

Your most welcome, however, I did try AppTV which is working very well for OS X! It shows an error but launches all the apps.

If you tweak the AppTV app, you can do much more, i.e. I have now managed to run .command shortcuts which is what I wanted!

If you know what you want and can do it via Terminal, for example fullscreen or launch firefox in fill screen, I'm sure AppTV can be tweaked into another bundle by itself with seperate art to do what you like!

So for example if I want to launch something like Transmission, I can just do it via AppTV known as Application TV in the screenshot below

7wFOBos.jpg?1

I created a app for my needs that looks into the Application folder for .command links from where I can run my HandBrakeCLI script or limit CPU Usage, the possibilities are great!

DB0ryrn.jpg?1

So after struggling with Caster.bundle I find AppTV referishingly neat, clean (no seperate folder with art required) and just works! Just sharing :)

Funny thing you should mention Application TV as It just recently started working for me as well. Out of the blue, it never worked before but i guess all the updates to PMS and HT finally meshed with the code to work Properly. I still like the premise in the way Caster can make "individual" channels. I wonder what is different between the two codes? Here is a screen shot of what Applicationtv does. With my set up when trying to start and individual application appTv says it fails but still opens the application.

https://www.dropbox.com/s/5yieps4bqxtk0wx/Screenshot%202014-07-03%2011.06.44.png 

I made the icon real quick one day to signify that this app can open anything. Not so pretty but it gets the job done.

second image is what the app says when I click on mac-blueray player. yet, it still opened the player.

https://www.dropbox.com/s/mv5pi40a2uivz7d/Screenshot%202014-07-03%2011.07.17.png

Funny thing you should mention Application TV as It just recently started working for me as well. Out of the blue, it never worked before but i guess all the updates to PMS and HT finally meshed with the code to work Properly. I still like the premise in the way Caster can make "individual" channels. I wonder what is different between the two codes? Here is a screen shot of what Applicationtv does. With my set up when trying to start and individual application appTv says it fails but still opens the application.

https://www.dropbox.com/s/5yieps4bqxtk0wx/Screenshot%202014-07-03%2011.06.44.png 

I made the icon real quick one day to signify that this app can open anything. Not so pretty but it gets the job done.

second image is what the app says when I click on mac-blueray player. yet, it still opened the player.

https://www.dropbox.com/s/mv5pi40a2uivz7d/Screenshot%202014-07-03%2011.07.17.png

Hey,

Looks neat :) Like the icon you made for yourself! I agree, in theory, if one has many applications they'd like to launch, Caster is definately the way to go! Plus the author has mantained a cross platform compatiability atleast for windows and OS X, not to mention Caster let's you pass arguments to the app launched, so you can do a full screen and what not.

For me, I just want to play around with code and have a customized channel to do stuff(not launching applications). Ppl. could use applescript to make their own apps in OS X and they use appTV, I haven't tried, in theory it should work, giving more flexability to the more tech savy ;)

The difference in the code, hmm, I wish I was more knowgeable to know, but at first glance, caster seems to be a more python based approach, appTV uses more of the methods and objects available by the plex plugin framework and what works for OS X(import os).

Since appTV works great for me, find the code cleaner, simple I will stick to it for my OS X PMS.

btw, just FYI, in the appTV bundle navigate to __init__.py in the contents > code folder and add the below line right at the end to get rid of the "channel not responding"

return MessageContainer(header = 'Application Launcher', message = 'Application Successfully Launched')

so it should now look like this

def LaunchApplication(sender, path):
    os.system("open " + path.replace(" ", "\\ "))
    return MessageContainer(header = 'Application Launcher', message = 'Application Successfully Launched')

Have fun! :)

This app is great!!! I have been able to get Hyperspin to work on my windows 8.1 box.

The problem is figuring out how to launch apps from the windows store with caster.

They are not built the same way and i have been unable to figure out how to get caster pointed to the right file to launch them.

Any help would be greatly appreciated 

Thanks

Is their anyway this could work over a network and not just locally, my server is on a separate machine then my htpc, and I would loveeeee to launch steam from plex home theater on my htpc, it would just need access to network locations, not just my c drive.

Or perhaps simpler, could you ever adapt this to plex home theater? Xbmc has advanced launcher, it would pretty powerful if pht had something like this for htpc users. My htpc's are on a different machine than my server.

I can go as far as to select the application and I still receive the "This Channel is not reponding error". Even after restarting PMS. I am using a Mac. Any other ideas/updates?

This app is great!!! I have been able to get Hyperspin to work on my windows 8.1 box.

The problem is figuring out how to launch apps from the windows store with caster.

They are not built the same way and i have been unable to figure out how to get caster pointed to the right file to launch them.

Any help would be greatly appreciated

Thanks

you can launch win 8 apps using explorer.exe and the appropriate command line argument. I use olby tile to find the command line parameters needed to launch the app I want. In the olby tile interface select the windows looking icon at the top, you should see a list of all available win 8 apps. Select the one you want to launch with caster. In the Program arguments text box to the left you should see a long string of text, copy that and use it the for the explorer.exe command line argument. That should launch your desired win8 app.

This is just what I've been after to add (manual) Wake on LAN to Plex. I have 3 NASs and only like to keep 1 on as that has most of the stuff I watch, but the other two need to be WoL and would prefer to do this within the app.

I've been trying to Add my Wake on LAN bat file which just calls a Wake on Lan CLI but keep getting "This Channel is Not Responding". I've tried both the BAT file and the exe.

Here's the logs: http://pastebin.com/P5wRRAbd

Anyone know if I'm doing it wrong?

Thanks!

Hello,

read all 6 pages but can't figure how create working Caster channel.

Follow instruction alway create a Plugin folder named 'caster_my_application_caster.bundle'

also if i specify name in right section.

Channel is created but if i run it, nothing happen.

I want to run an emulator to allow my child play on tv using PLEX.

Anyone can post folder zip of working caster channel ?

(eg: running an .exe)

thank you for any reply,

m.