access second argument of url string
access second argument of url string
http://192.168.2.103/index.html?volumeZ1&1b
volumez1 is the event and the above appears like this in eventghost
HTTP.volumeZ1 [u'1b']
How do I access the 1b argument to pass it to a plugin command.
volumez1 is the event and the above appears like this in eventghost
HTTP.volumeZ1 [u'1b']
How do I access the 1b argument to pass it to a plugin command.
Re: access second argument of url string
This is the payload of the event. use eg.event.payload in a macro. Since the payload is a list in this case you have to use eg.event.payload[0]
Re: access second argument of url string
do I have to put it in curly brackets or anything? The variable I always end up getting is the string literal eg.event.payload[0]
Re: access second argument of url string
That's right. Curly braces trigger the evaluating mechanism of EG.
Re: access second argument of url string
also, within a plugin script how can I test to see if eg.event exists without throwing a NoneType error when it doesnt?
Re: access second argument of url string
Fiasco wrote:also, within a plugin script how can I test to see if eg.event exists without throwing a NoneType error when it doesnt?
Code: Select all
if eg.event:
#do your stuff
Re: access second argument of url string
I've got my onkyo macros on the right screen of eventghost.Bartman wrote:That's right. Curly braces trigger the evaluating mechanism of EG.
I tried putting {eg.event.payload[0]} as the argument to the macro but within the script I end up with a string literal of {eg.event.payload[0]}
Re: access second argument of url string
call eg.ParseString to evalute the input