Author |
|
smarty Super User
Joined: May 21 2006 Location: United States
Online Status: Offline Posts: 728
|
Posted: October 28 2006 at 20:49 | IP Logged
|
|
|
I am trying to send a formula from Xlobby to PowerHome via phsscmd (PowerHome Socket Server). Manny started me on this, and it works well.
My formula I want to send is:
ph_wcopen(1, "http://www.pandora.com/?sc=sh158735660495974917") This formula WORKS in PH (I tried it).
But, to send it from Xlobby, I need to write it inside of:
ph_formula(" ") <=and it should be in quotes.
Any idea how it should look?
ph_formula( 'ph_wcopen(1, "http://www.pandora.com/?sc=sh158735660495974917" ') doesn't work.
Any help is appreciated.
__________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
|
Back to Top |
|
|
Manny Senior Member
Joined: March 23 2003 Location: United States
Online Status: Offline Posts: 172
|
Posted: October 28 2006 at 21:09 | IP Logged
|
|
|
Hey Smarty,
Have you tried using the tilde character? ~
I'm just guessing here and not sure it will work as the thread I'm quoting Dave from about quotes deals with web pages.
1. PowerScript will recognize strings surrounded by both single or double quotes. If you want to embed a single quote within a string, surround the string with double quotes. If you want to embed a double quote within a string, surround the string with single quotes.
2. In PowerScript, you can also prefix a single or double quote with one or more ~ (tilde) characters to embed quotes. For example...if you wanted to surround a string with single quotes and embed a single quote, you could do it like this: 'This is an embedded single quote ~' in the middle of this string'.
Here's the .
thread
Edited by Manny - October 28 2006 at 21:10
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: October 28 2006 at 21:15 | IP Logged
|
|
|
Smarty,
Manny has you covered. However, the part I don't understand is why you need to pass the ph_wcopen function within a ph_formula function. PHSSCMD should be able to send the ph_wcopen function directly.
Anyways, what you posted should work. Either
ph_formula( 'ph_wcopen(1, "http://www.pandora.com/?sc=sh158735660495974917" ')
or
ph_formula( "ph_wcopen(1, 'http://www.pandora.com/?sc=sh158735660495974917' ")
should be valid statements in regards to single and double quotes.
Give me a little more details and I'll see if I can pinpoint what's going on for you.
Dave.
|
Back to Top |
|
|
Manny Senior Member
Joined: March 23 2003 Location: United States
Online Status: Offline Posts: 172
|
Posted: October 28 2006 at 22:03 | IP Logged
|
|
|
Yep.
phsscmd.exe ph_wcopen(1,"http://www.pandora.com/?sc=sh158735660495974917 ")
opened the Pandora site within PowerHome's internal web browser when I ran it from XLobby.
PS
I'm a Pandora fan too.
|
Back to Top |
|
|
smarty Super User
Joined: May 21 2006 Location: United States
Online Status: Offline Posts: 728
|
Posted: October 29 2006 at 08:54 | IP Logged
|
|
|
Thanks Manny and Dave .
__________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: March 14 2008 at 11:00 | IP Logged
|
|
|
In the vein of this thread, I'm having trouble finding quotes that work beyond two deep for use in eHome.
I've tried tildes and backslashes, but it seems only ' and " work.
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: March 14 2008 at 13:38 | IP Logged
|
|
|
Still wondering about the quotes, but found using "& chr$(34) &" worked in a VBS.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: March 20 2008 at 23:25 | IP Logged
|
|
|
Tony,
Do you have a sample of what you're trying to send (and how you're trying to send it because it sometimes makes a difference)?
Usually, you just need to use one or more tilde characters for embedded double and single quotes. If it's real tricky, you should also be able to use the PH equivalent of chr$ like this: " + char(34) + "
Let me know,
Dave.
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: March 21 2008 at 07:30 | IP Logged
|
|
|
Hey Dave!
What I started with was this...
Code:
ph_rtne( ph_setvar_a( 1, 1, ph_winampinfo( "listpos", 0, 0 ) ) + ph_setvar_a( 1, 2, 3 ) + ph_setvar_a( 1, 3, "" )) + ph_rtne( ph_setvar_a( 1, 4, ph_getvar_n( 1, 1) - ph_getvar_n( 1, 2)) ) + ph_rtne( ph_forloopwinc("ph_concatvar( 1, 3, if( ph_winampinfo( 'listtitlename', ph_getvar_n( 1, 4 ), 0)='', '', ph_getvar_n( 1, 4 ) + ': ' + if( ph_getvar_n( 1, 4) = ph_getvar_n( 1, 1), '> ', '' ) + ph_winampinfo( 'listtitlename', ph_getvar_n( 1, 4 ), 0) + '<br>'))",ph_getvar_n( 1, 1) - ph_getvar_n( 1, 2),ph_getvar_n( 1, 1) + ph_getvar_n( 1, 2), 1, 4)) + ph_getvar_s( 1, 3) |
|
|
It is wrapped in double quotes, so I needed to switch out the ones used here.
I also did some testing with phsscmd using this and was not able to find escaped quotes that worked. These were the only ones that did.
Code:
"D:\Program Files\PHSSCMD\phsscmd.exe" ph_macro("PLAY PAUSE")
"D:\Program Files\PHSSCMD\phsscmd.exe" ph_macro('PLAY PAUSE') |
|
|
Edited by TonyNo - March 26 2008 at 07:21
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: March 30 2008 at 10:53 | IP Logged
|
|
|
I'm new to PowerHome so this observation may not mean anything but the "doesn't work" statement in the first post is not balanced.
ph_formula( 'ph_wcopen(1, "http://www.pandora.com/?sc=sh158735660495974917" ') doesn't work
There are two open parens "(" but only one closed paren ")". Maybe a typo when entered in the forum? Most syntax scanners won't like unbalanced statements.
__________________ Lee G
|
Back to Top |
|
|