Skip to content

Commit abc37f7

Browse files
Updated with Andreas Jordan replace `r magic :-)
1 parent d3090eb commit abc37f7

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

PowerPointSlobs.ps1

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
#Requires -Version 5.1
1+
<#
2+
3+
This rough and ready script will change the scene in Streamlabs
4+
when the PowerPoint Slide changes
5+
AND
6+
the first line of the notes on the slide
7+
is
8+
9+
OBS:NAMEOFSCENE
10+
11+
It will only work on Windows PowerShell unless someone knows how
12+
to get PowerPoint com objects with events in PowerShell core.
13+
14+
#>
215
#region Setup Slobs
316
function Add-BeardSlobsConnection {
417
$npipeClient = New-Object System.IO.Pipes.NamedPipeClientStream($Env:ComputerName, 'slobs', [System.IO.Pipes.PipeDirection]::InOut, [System.IO.Pipes.PipeOptions]::None, [System.Security.Principal.TokenImpersonationLevel]::Impersonation)
@@ -51,7 +64,7 @@ function Set-BeardSlobsNextSlide {
5164
$notes = $PowerPoint.SlideShowWindows[1].View.Slide.NotesPage.Shapes[2].TextFrame.TextRange.Text
5265
if ($Notes) {
5366
Write-Host "The notes are $notes"
54-
$SceneName = $notes -replace 'OBS:', ''
67+
$SceneName = ($notes -split "`r")[0] -replace 'OBS:', ''
5568
Write-Host "The scene name is $SceneName"
5669
Set-BeardSlobsObsScene -SceneName $SceneName
5770
}

0 commit comments

Comments
 (0)