The only issue left that I have is that I need to quit the App from the task manager. It won't exit on itself when I want to shut off the computer.
That last updated code would fix that?
Thanks
i never had this problem but updated to the new code cause when quitting the app in the new code it's quitting the python processes too which it didn't on the first code.
anyway, after adding the app to keychain access and to login items never had this problem.
The only issue left that I have is that I need to quit the App from the task manager. It won't exit on itself when I want to shut off the computer.
That last updated code would fix that?
Thanks
Yes it should. The issue as described above was that the on quit action didn't have access to the saved name and password. It does now.
Here is a custom icon for Plex Connect if anyone is looking for one. Easiest way to apply this to the AppleScript app is to open this icon in Preview, edit > copy. Now right click on your AppleScript app and select Get Info. On the Info tab at the top left, click on the tiny Applescript icon so it is highlighted in blue and select edit > paste. Now close Get Info and your App icon is updated. no need for your to convert this as an icns file.
Here is a custom icon for Plex Connect if anyone is looking for one. Easiest way to apply this to the AppleScript app is to open this icon in Preview, edit > copy. Now right click on your AppleScript app and select Get Info. On the Info tab at the top right, click on the tiny icon so it is highlighted in blue and select edit > paste. Now close Get Info and your App icon is updated. no need for your to convert this as an icns file.
I have one last issue with the script, I realize now.
I rely on the usr/bin/env python shebang to select the python version that is located in usr/local/bin. This works fine when I run Plexconnect in terminal but when I run it through the AppleScript it uses the default python in usr/bin. This is a problem when you are using OSX 10.6.8 whose default python is 2.6 which is not fully compatible with Plexconnect and causes UI glitches on the preplay screen.
Is there anyway to write the script so it respects the usr/bin/env python shebang? In the meantime I have edited the Plexconnect.py shebang to go directly to usr/local/bin/python.
I am using the daemon version as created by chulbert. I am wondering, what is he advantage to the approach we discussing here?
If you are bouncing between multiple builds or even updating your builds frequently, this method allows you to use the stock PlexConnect scripts and have a handy way to start/stop them and add them as a login item. Otherwise, every time a new build is released, the documented changes have to be made to those files to suppress output and change the functionality of PlexConnect to allow it to run as a daemon.
the new script from post #97 works for me when i start it by myself but when i but it into autostart it wont work. apple tv keeps saying trailer is not availabe. any hint how to fix this?
the new script from post #97 works for me when i start it by myself but when i but it into autostart it wont work. apple tv keeps saying trailer is not availabe. any hint how to fix this?
Have you added this as a log on item? When you restart, can you see the app running in the dock?
yep its set a log on item via users in settings and the app is running in the dock
Do you have your mac set to sleep? Plex Connect will not function if the mac is sleeping as it needs to be awake to intercept the Trailers url request from the Apple TV. If you get a message that trailers is not available, check the mac is not asleep or do something specific to ensure the mac is awake and try again. I use my iPhone to wake my Mac when I want to use Plex on the ATV in the bedroom - mac is sleeping in the livingroom.
Do you have your mac set to sleep? Plex Connect will not function if the mac is sleeping as it needs to be awake to intercept the Trailers url request from the Apple TV. If you get a message that trailers is not available, check the mac is not asleep or do something specific to ensure the mac is awake and try again. I use my iPhone to wake my Mac when I want to use Plex on the ATV in the bedroom - mac is sleeping in the livingroom.
my mac is always on. the script doesnt work right after boot i have to quit and then to start it again to make it work
It could be the order in which Plexconnect and Plex Media Server are opening. Drag the login items in System Pref > Accounts > Login items around so PMS opens first and Plexconnect last.
There used to be a line you could uncomment in the script that would delay the opening of Plexconnect by 10 seconds or so but it is not there anymore.
Do you have your mac set to sleep? Plex Connect will not function if the mac is sleeping as it needs to be awake to intercept the Trailers url request from the Apple TV. If you get a message that trailers is not available, check the mac is not asleep or do something specific to ensure the mac is awake and try again. I use my iPhone to wake my Mac when I want to use Plex on the ATV in the bedroom - mac is sleeping in the livingroom.
i had this problems too, mac was set to never sleep but display sleep was on and put hard disks to sleep when possible. turned off put hard disks to sleep and everything is great right now. if there'll be a way to keep the app running good when computer sleeps it'll be great.
for foob4r, baa and all the great people working on plexconnect i recommend, for mac, to switch the current guide to guide from #97. it's easier and it'll be extremely easy with pictures.
It could be the order in which Plexconnect and Plex Media Server are opening. Drag the login items in System Pref > Accounts > Login items around so PMS opens first and Plexconnect last.
There used to be a line you could uncomment in the script that would delay the opening of Plexconnect by 10 seconds or so but it is not there anymore.
PlexConnect gets started after PMS so thats not the problem hmmm..
i had this problems too, mac was set to never sleep but display sleep was on and put hard disks to sleep when possible. turned off put hard disks to sleep and everything is great right now. if there'll be a way to keep the app running good when computer sleeps it'll be great.
for foob4r, baa and all the great people working on plexconnect i recommend, for mac, to switch the current guide to guide from #97. it's easier and it'll be extremely easy with pictures.
No because this method creates a security hole that can expose your administrative password giving an attacker full access to your machine and data.
I am not stopping anyone using this method and Chris has clearly stated the issue with it but we will not officially support it, especially when we have a much better method to come ;)
No because this method creates a security hole that can expose your administrative password giving an attacker full access to your machine and data.
I am not stopping anyone using this method and Chris has clearly stated the issue with it but we will not officially support it, especially when we have a much better method to come ;)
how does it give full address if i'm copying the script and everyone will manually will put there details in...?
I continuously run into the issue when attempting to run the Script
error "The administrator user name or password was incorrect." number -60007
i can't for the life of me figure out why.
I allow when prompted to use the keychain item
Thanks for taking your time to write this script.
global py
global un
global theKeychainItem
global thePassword
set py to "***set correct path***/PlexConnect.py"
set theKeychainItem to "plexconnect"
set un to getUsername(theKeychainItem)
set thePassword to getPassword(theKeychainItem)
do shell script "screen -A -m -d -S PlexConnect " & py user name un password thePassword with administrator privileges
on quit
do shell script "kill `ps -u root | grep [P]lexConnect | grep [Pp]ython | awk '{print $2}'`" user name un password thePassword with administrator privileges
continue quit
end quit
on getPassword(KeychainItem)
set theResult to do shell script "security 2>&1 find-generic-password -gs " & KeychainItem
set theResult to extractData(theResult, "password: \"", "\"", 0)
return theResult
end getPassword
on getUsername(KeychainItem)
set theResult to do shell script "security 2>&1 find-generic-password -gs " & KeychainItem
set theResult to extractData(theResult, "\"acct\"=\"", "\"", 0)
return theResult
end getUsername
on extractData(theText, theFieldName, theEndDelimiter, spaces)
set theDataStart to the offset of theFieldName in theText
if theDataStart = 0 then
return ""
else
set theDataStart to theDataStart + (length of theFieldName) + spaces
set theData to text theDataStart through end of theText
set theDataEnd to ((offset of theEndDelimiter in theData) - 1)
set theData to text 1 through theDataEnd of theData
end if
end extractData