Has anyone created an AppleScript/Application to launch PlexConnect at startup?

What operating system version are you using?

What operating system version are you using?

OS X 10.8.4 (Macbook Pro mid 2011)

Forget it. My fault. I didn't introduced the keychain properly.

Anyway it's not working for me. I see the script running on startup but ATV cannot access (accessing trailers issue). If I start plexconnect in terminal it works perfect.

I don't know what can I'm doing wrong...

If you launch the script, then try via terminal, does it work? Or do you get

Failed to create socket on UDP port XY: [Errno 48] Address already in use

Desperate, the problem there is that the prior instance of Plexconnect did not shut down properly. Go into Activity Monitor and quit all Python processes. That will kill the prior instance for you.

Just to make sure, did you use the most recent instance of the script from post #97?

Thanks heaps Institute, I killed all running python processes with no hope at all, and it just worked first try after that. That is very weird though. Maybe something was left open when running PC from the terminal!?

Anyway thanks a lot and yes I was using code from post #97.

If you launch the script, then try via terminal, does it work? Or do you get

Failed to create socket on UDP port XY: [Errno 48] Address already in use

Exactly, I get this error. That's supposed to be that plexconnect is already running.

The script seems to be working (I can shut it down normally) but I cannot connect with the ATV (I have well configurated the DNS).

FYI my OS is Snow Leopard (10.6)

One thing that is a bit annoying is that when my Mac Mini starts, I have to enter my password because security is asking for it. Can I get rid off it? I only want to turn on my Mac, sit on the sofa and after 10 seconds use the ATV xD

Thanks in advance!

Phrancis,

For Snow Leopard and the Applescript to work properly you will need to change the shebang line in Plexconnct.py from

usr/bin/env python

To

usr/local/bin/python


Otherwise it will use the old system version of Python rather than the 2.7 version you installed.

As for the password, it means you have not set up the keychain item properly for the script. Go back to post 97 and redo the keychain steps.

Nice!! It works for me now. Thank you very much.


I don’t know if someone miss this feature but for me it would be very useful to be able to turn off Mac Mini from ATV like we can in Plex for OSX.


Is there anyway to do that?

Same here. I gave up.

I had similar issues and it all had to do with the path specified for the certificate. If you have a relative path (./assets/certificates/trailers.pem) plexconnect will run but the certificate is not referenced correctly since the AppleScript is not in the same directory as the python executable.

I was able to get it to work by specifying the path absolutely (/Users/me/Desktop/PlexConnect/assets/certificates/trailers.pem)

This one change fixed it for me.

This is no longer necessary Chris. The more recent Plexconnect builds resolve the path as absolute when necessary even if you leave the default, as is, in settings.cfg, Just make sure the trailers.pem file is in the assets/certificates folder.

This is no longer necessary Chris. The more recent Plexconnect builds resolve the path as absolute when necessary even if you leave the default, as is, in settings.cfg, Just make sure the trailers.pem file is in the assets/certificates folder.

odd. I got the first build for the certs working, tried the latest, trailers would never correct. Deleted all files went back to original plexconnect with cert and it works fine again.

Made sure I moved the cert file, copied the settings, made it exactly the same, no go. Spent a few hrs on it and went back to working version. sad :(

For those who are finding on older Mac OS versions, such as 10.6.x, with updated Python and they find that post upgrade that they can run the PlexConnect.py script from the command line just fine, but it doesn't work in AppleScript, I have a possible solution for you.

See this post:

http://forums.plexapp.com/index.php/topic/80176-updated-plexconnect-now-its-not-working/#entry461482

You may need to explicitly specify the full path to your newer Python in your AppleScript to make it work.

So, instead of simply calling "/pathto/PlexConnect.py" you might need to say "/anotherpathto/python /pathto/PlexConnect.py". My entries here are examples, and you would need to replace with your respectively correct full paths.

It worked for me, so thought it would put it out there in case it helped others.

P

I will try that out, as mentioned previously, on OSX 10.6.8 I have been simply changing the shebang line in Plexconnect.py from

usr/bin/env python

To

usr/local/bin/python

That will also select the newly installed version of Python and bypass the defaut install, but I have to do that every time I upgrade Pleconnect.

See next post.

OK , I have it working on OSX 10.6.8 now where the Applescript calls the correct Python version that is installed as PATH. Here is the pertinent line where I took Pensivemonks lead and combined the python path with the absolute path for the Plexconnect.py. It looks like this, and, yes, the space is needed after "python" and before "/Users/":

set py to "/usr/local/bin/python /Users/username/Desktop/PlexConnect-master/PlexConnect.py"

 

Change the absolute path for the Plexconnect.py file as appropriate for your setup. Thanks for the suggestion Pensivemonk. This saves some editing when I upgrade Plexconnect.

No problem at all. Glad it helped.

It had been driving me crazy, until I figured it out.

I had tried a few different methods of running PlexConnect, but the best benefit of the AppleScript methods over others is you can upgrade the PlexConnect scripts easily with no hunting through and re-editing files. Just save your settings and go...

Cheers!

plex media server plist made by me :P (requires com.plex.plexconnect.plist loaded via 
launchctl & modified plexconnect.py installed in your plex connect folder) This will 
run plex after you login not at boot since at this time plex cannot start at boot 
since it was coded that way. This will keep plex running even if it crashes and if 
the plex media center app ever coded differently it will load plex prior to login.



1. Copy your plex app and rename it to PMS in /applications
2. Show package contents of your new app PMS and rename Applications/PMS.app/Contents/MacOS/Plex Media Server to PMS
3. Copy the com.plex.pms.plist to /library/lauchdaemons
4. Fire up terminal and sudo su enter password.
5. Change directory to /library/launchdaemons
6. Enter this in terminal: chown root:wheel com.plex.pms.plist
7. Then this: sudo launchctl load /Library/LaunchDaemons/com.plex.pms.plist
8. I also added this to plexconnect.py above (import sys, time) at the beginning of the file I dont know if its needed but I wanted to be sure PMS was up and running prior to PLEX CONNECT Launchctl plist:

import time
time.sleep(.5)

Hope this help you guys enjoy smile_osx.png

Here is the link for the plist:


https://github.com/wahlmanj/com.plex.pms.plist

Hey this make sense, expect 1. Copy your plex app and rename it to PMS in /applications

What plex app?

I just have a folder with plexconnect.

UPDATE!

AND THE PLEX MEDIA SERVER PLIST IS BORN! Made by me icon_razz.gif

1. Copy your plex app and rename it to PMS in /applications
2. Show package contents of your new app PMS and rename Applications/PMS.app/Contents/MacOS/Plex Media Server to PMS
3. Copy the com.plex.pms.plist to /library/lauchdaemons
4. Fire up terminal and sudo su enter password.
5. Change directory to /library/launchdaemons
6. Enter this in terminal: chown root:wheel com.plex.pms.plist
7. Then this: sudo launchctl load /Library/LaunchDaemons/com.plex.pms.plist
8. I also added this to plexconnect.py above (import sys, time) at the beginning of the file I dont know if its needed but I wanted to be sure PMS was up and running prior to PLEX CONNECT Launchctl plist:

import time
time.sleep(.5)

Hope this help you guys enjoy smile_osx.png

Here is the link for the plist:

http://www.tonymacx86.com/other-apple-hardware/105363-plexconnect-fully-functioning-plex-client-apple-tv-3.html

You dont have to rename /applications/plex media server.app to pms.app if you dont want to it works either way as long as you change the plist accordingly to whatever name u like same goes for renaming the other portion to pms as well