vMix Forums
»
General
»
General Discussion
»
carriage return through api to title
Rank: Advanced Member
Groups: Registered
Joined: 4/11/2015(UTC) Posts: 64 Location: Home Thanks: 7 times Was thanked: 3 time(s) in 3 post(s)
|
I have a powershell script that updates titles to show videos playing in a list. title one shows now playing title 2 shows title to play next and time it will start Now I am trying to add title3 which will show the next 12 videos to play and times they will start. The problem I have is when updating a title to display the list it ignores carriage returns.. How do I get the title editor to recognize a carriage return.. When I use Vmixes title editor and just press enter it works.. I need to pass the carriage return via a variable through the web api.. In powershell Code:
$tvguidetitle = $list + "chr$(13)"
$tvguidetitle = $tvguidetitle + $list0 + "chr$(13)"
$tvguidetitle = $tvguidetitle + $list2 + "chr$(13)"
$tvguidetitle = $tvguidetitle += $list4 + "chr$(13)"
$tvguidetitle = $tvguidetitle += $list6 + "chr$(13)"
$tvguidetitle = $tvguidetitle += $list8 + "chr$(13)"
$tvguidetitle = $tvguidetitle += $list10 + "chr$(13)"
$tvguidetitle = $tvguidetitle += $list12 + "chr$(13)"
$tvguidetitle = $tvguidetitle += $list14 + "chr$(13)"
$tvguidetitle = $tvguidetitle += $list16 + "chr$(13)"
$tvguidetitle = $tvguidetitle += $list18 + "chr$(13)"
$tvguidetitle = $tvguidetitle += $list20 + "chr$(13)"
$tvguidetitle = $tvguidetitle += $list22 + "chr$(13)"
$tvguidetitle = $tvguidetitle += $list24 + "chr$(13)"
$tvguidetitle = $tvguidetitle += $list26 + "chr$(13)"
(New-Object System.Net.WebClient).DownloadString("http://192.168.1.152:8088/API/?Function=SetText&Input=5&SelectedName=Message&Value=$tvguidetitle")
I've tried + "'n" + "chr$(13)" (thats the ascii equalvalent to a linefeed/carriage return) Anyone have any ideas?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 4/11/2015(UTC) Posts: 64 Location: Home Thanks: 7 times Was thanked: 3 time(s) in 3 post(s)
|
Oh, I'm using the TextHD title preset as input5
|
|
|
|
Rank: Member
Groups: Registered
Joined: 10/28/2014(UTC) Posts: 16 Location: Rotherham, UK
Thanks: 34 times Was thanked: 6 time(s) in 4 post(s)
|
I know this is an old post but having just dealt with this on something I was working I thought it best to put the solution here as a reference for anyone else.
When sending text to titles using the HTTP API, special characters need to be URL encoded for it work. In the case of Carraige Return you need to use %0D and for New Line you need to use %0A.
One exmplae from above would be to replace the string "chr$(13)" with "%0D%0A" giving a line from the code as:
$tvguidetitle = $tvguidetitle + $list0 + "%0D%0A"
The same thing applies when using the HTTP API for increment values in a text field, the "+=" can be replaced with "%2B%3D"
Cheers,
Stavlin
|
2 users thanked Stavlin for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 3/20/2014(UTC) Posts: 2,721 Location: Bordeaux, France Thanks: 243 times Was thanked: 794 time(s) in 589 post(s)
|
Quote:special characters need to be URL encoded for it work Thanks!!! I scratched my head many times on this one... Just checked to see if it also works when using CSV imports in Title Editor... Apparently not... A solution ?
|
|
|
|
vMix Forums
»
General
»
General Discussion
»
carriage return through api to title
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close