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

It's OS X 10.8.4

Open Activity Monitor (in Utilities folder). Look for Python processes, quit all of them. That will kill Plexconnect.

Thks. But it has no effect, and Trailer are still not accessible.

It was working so nicely before... I don't understand why it doesn't any more. :wacko:

Last log : 

20:47:18 PlexConnect: started: 20:47:18
20:47:18 PlexConnect: ***
20:47:18 PlexConnect: PlexConnect
20:47:18 PlexConnect: Press ENTER to shut down.
20:47:18 PlexConnect: ***
20:47:18 PlexConnect: IP_self: 192.168.1.28
20:47:18 PlexConnect: started: 20:47:18
20:47:18 PlexGDM: ***
20:47:18 PlexGDM: looking up Plex Media Server
20:47:18 PlexGDM: ***
20:47:19 PlexGDM: servers discovered: 1
20:47:19 PlexConnect: PMS: 192.168.1.28:32400
20:47:19 DNSServer: started: 20:47:19
20:47:19 DNSServer: ***
20:47:19 DNSServer: Starting up.
20:47:19 DNSServer: intercept trailers.apple.com: 192.168.1.28
20:47:19 DNSServer: forward other to higher level DNS: 8.8.8.8
20:47:19 DNSServer: ***
20:47:19 WebServer: started: 20:47:19
20:47:19 WebServer: ***
20:47:19 WebServer: WebServer: Serving HTTP on 0.0.0.0 port 80.
20:47:19 WebServer: ***
20:47:35 DNSServer: DNS request received!
20:47:35 DNSServer: Source: ('192.168.1.39', 52601)
20:47:35 DNSServer: Domain: init-p01st.push.apple.com
20:47:35 DNSServer: ***forward request
20:47:35 DNSServer: -> DNS response from higher level
20:47:35 DNSServer: DNS request received!
20:47:35 DNSServer: Source: ('192.168.1.39', 60394)
20:47:35 DNSServer: Domain: 1-courier.push.apple.com
20:47:35 DNSServer: ***forward request
20:47:35 DNSServer: -> DNS response from higher level
20:47:40 DNSServer: DNS request received!
20:47:40 DNSServer: Source: ('192.168.1.39', 64576)
20:47:40 DNSServer: Domain: ax.init.itunes.apple.com
20:47:40 DNSServer: ***forward request
20:47:40 DNSServer: -> DNS response from higher level
20:47:40 DNSServer: DNS request received!
20:47:40 DNSServer: Source: ('192.168.1.39', 51163)
20:47:40 DNSServer: Domain: itunes.apple.com
20:47:40 DNSServer: ***forward request
20:47:40 DNSServer: -> DNS response from higher level
20:47:42 DNSServer: DNS request received!
20:47:42 DNSServer: Source: ('192.168.1.39', 57654)
20:47:42 DNSServer: Domain: configuration.apple.com
20:47:42 DNSServer: ***forward request
20:47:42 DNSServer: -> DNS response from higher level
20:49:12 DNSServer: DNS request received!
20:49:12 DNSServer: Source: ('192.168.1.39', 62530)
20:49:12 DNSServer: Domain: data.iana.org
20:49:12 DNSServer: ***forward request
20:49:12 DNSServer: -> DNS response from higher level
20:54:52 DNSServer: DNS request received!
20:54:52 DNSServer: Source: ('192.168.1.39', 50400)
20:54:52 DNSServer: Domain: s.mzstatic.com
20:54:52 DNSServer: ***forward request
20:54:52 DNSServer: -> DNS response from higher level
20:54:54 DNSServer: DNS request received!
20:54:54 DNSServer: Source: ('192.168.1.39', 50991)
20:54:54 DNSServer: Domain: trailers.apple.com
20:54:54 DNSServer: ***intercept request
20:54:54 DNSServer: -> DNS response: 192.168.1.28

Dennis,

Are you using an absolute path or the default relative path for your certfile? I am wondering if the relative path works with terminal but not with the script.

I just did some research and seems relative paths are not supported in Applescripts. Nathan Grigg writes:

"Relative paths are not supported (except when run from a shell; see below) and tilde expansion is not supported."

So this is probably why some people are having issues with the default certfile path as found in Settings.cfg. Anyone who is using the Applescript must use absolute paths to their "trailers.pem" file.

That’s the solution. I just changed to an absolute path and now it works.

Thanks a lot!


sent via Tapatalk

I just did some research and seems relative paths are not supported in Applescripts. Nathan Grigg writes:

"Relative paths are not supported (except when run from a shell; see below) and tilde expansion is not supported."

So this is probably why some people are having issues with the default certfile path as found in Settings.cfg. Anyone who is using the Applescript must use absolute paths to their "trailers.pem" file.

How absolute is "absolute"?  I had it running early today using the "~/PlexConnect/..." since it's in my home directory, and starting with the Terminal sudo launch.

But running it with the AppleScript to I have to go all the way back to root to enter the path?

If so, do I enter the path in the Settings.cfg with the Volume name (that has a space) using the single quote marks, or using the backslash style?

e.g. - /Volumes/Macintosh\ HD/Users/richard/PlexConnect/assets/certificates/trailers.pem

or - /Volumes/'Macintosh HD'/Users/richard/PlexConnect/assets/certificates/trailers.pem

My Users directory is not on my internal SSD so just "/Users/richard/..." won't work

Mine looks like this:

/Users/yourusername/Desktop/Plexconnect-master/assets/certificates/trailers.pem

But you say that wont work for you. So try a few options and see what works.

the app still works so awesome after fix. my pem is in the desktop

Users/My UserName>Desktop>trailers.pem

I'm having similar issues as Dennis above.  aTV updated -- so I updated plexconnect.   It works flawless when I launch it from terminal but when I use the script it doesn't work.  I tried both absolute and relative paths in the settings.cfg ...  It worked great before the stupid aTV update.  Running on OSX 10.8.4.

I'm having similar issues as Dennis above.  aTV updated -- so I updated plexconnect.   It works flawless when I launch it from terminal but when I use the script it doesn't work.  I tried both absolute and relative paths in the settings.cfg ...  It worked great before the stupid aTV update.  Running on OSX 10.8.4.

Same here, actually.  I have been using the PlexConnect.app for a while and whenever a new update for PlexConnect was put on GitHub i would just replace the files within the .app and every thing always worked fine. But now launching the app doesn't work. 

But, if I navigate to the PlexConnect.py file within the .app and launch it from Terminal then it works.

Very weird.

Same here, actually.  I have been using the PlexConnect.app for a while and whenever a new update for PlexConnect was put on GitHub i would just replace the files within the .app and every thing always worked fine. But now launching the app doesn't work. 

But, if I navigate to the PlexConnect.py file within the .app and launch it from Terminal then it works.

Very weird.

what do you mean within the app? the app (in this thread) is using plexconnect folder that's not in it ..

for me it's still works like a charm.

Hi!

So I've been around for a while, but this is my first post. So firstly, a big thanks for all the hard work folks!

I've only bought my first aTV two weeks ago, so I'm new to PlexConnect.

I'm trying to solve an issue with this script, that doesn't work for me yet. I have the returned Result "" in less than a second in AppleScript Editor, and I get Trailers is unavailable on the aTV.

./PlexConnect.py works great in Terminal.

I noticed that:

  1. if I run PlexConnect in Terminal... it works great.
  2. then I run the script from AppleScript Editor... nothing's happening
  3. I try PlexConnect in Terminal again and I get the following:
    <pre class="_prettyXprint">
    

    00:10:16 PlexConnect: ***
    00:10:16 PlexConnect: PlexConnect
    00:10:16 PlexConnect: Press CTRL-C to shut down.
    00:10:16 PlexConnect: ***
    00:10:16 PlexConnect: started: 00:10:16
    00:10:16 PlexConnect: IP_self: 192.168.1.3
    00:10:16 DNSServer: started: 00:10:16
    00:10:16 DNSServer: Failed to create socket on UDP port 53: [Errno 48] Address already in use
    00:10:16 PlexConnect: DNSServer not alive. Shutting down.
    00:10:16 PlexConnect: Shutting down.
    00:10:16 PlexConnect: shutdown


I'll now need to restart my MacBook Pro 10.8.4 for PlexConnect to work in Terminal.

Hope that makes sense and that you can maybe help me.

Thanks!

Mine looks like this: Users/yourusername/Desktop/Plexconnect-master/assets/certificates/trailers.pem But you say that wont work for you. So try a few options and see what works.

I tried all the permutations I could think of 

  • .../'Macintosh HD'/...
  • .../Macintosh\ HD/...
  • ~/Plexconnect/...

and none of them worked - I must be missing a way of "spelling" the Volume (directory) name with a space so that it's parsed properly

So, I created a PlexConnect directory in the otherwise empty "/Users/richard/..." directory on the SSD, specified the directory as "/Users/richard/..." in the Settings.cfg and it worked just fine

BTW - thank the gods for whoever added the certificate check to the startup logging - that made my life way easier than: edit the file, run downstairs "CRAP!", run upstairs, edit the file, run downstairs, "CRAP!", run upstairs - lather, rinse, repeat!

For those who the Applescript isn’t working at all I would check to see if the path to the “Plexconnect.py” is still correct in the AppleScript itself. Then make sure you have the correct absolute path for the trailers.pem in settings.cfg.

For those who the Applescript isn't working at all I would check to see if the path to the "Plexconnect.py" is still correct in the AppleScript itself. Then make sure you have the correct absolute path for the trailers.pem in settings.cfg.

Re my issue it's totally fine since it creates the socket. It probably crashes right after leaving it open..

Thanks!

So the AppleScript starts up and then crashes?

Hard to say. AppleScript doesn't crash no. When I hit 'Run' the red stop icon flashes and nothing seems to happen. The Result returns an empty string "". 

Note: I run LittleSnitch but have opened everything for AppleScript.

Thanks!

Hi there. I’ve been trying to add this script and I get one error:


“Security: SecKeyChainSearchCopyNext: The specified item could not be found in the keychain”


Maybe it cannot acces the keychain for some reason?


Thanks a lot.

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…

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

Same here. I gave up.