logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
mitchstein443  
#1 Posted : Saturday, April 4, 2020 8:10:13 AM(UTC)
mitchstein443

Rank: Advanced Member

Groups: Registered
Joined: 4/11/2015(UTC)
Posts: 61
Man
United States
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?
mitchstein443  
#2 Posted : Saturday, April 4, 2020 8:11:47 AM(UTC)
mitchstein443

Rank: Advanced Member

Groups: Registered
Joined: 4/11/2015(UTC)
Posts: 61
Man
United States
Location: Home

Thanks: 7 times
Was thanked: 3 time(s) in 3 post(s)
Oh, I'm using the TextHD title preset as input5
Stavlin  
#3 Posted : Friday, November 27, 2020 7:11:43 AM(UTC)
Stavlin

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

thanks 2 users thanked Stavlin for this useful post.
DWAM on 11/27/2020(UTC), mitchstein443 on 7/28/2022(UTC)
DWAM  
#4 Posted : Friday, November 27, 2020 7:45:02 AM(UTC)
DWAM

Rank: Advanced Member

Groups: Registered
Joined: 3/20/2014(UTC)
Posts: 2,721
Man
France
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 ?
Users browsing this topic
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.