Set application = WScript.CreateObject("PowerPoint.Application")

Function CurrentSection()
	Set presentation = application.ActivePresentation.Slides(CurrentSlide())
	CurrentSection = presentation.sectionIndex
End Function

Function CurrentSlide()
	If application.SlideShowWindows.Count > 0 Then
		CurrentSlide = application.SlideShowWindows.Item(1).View.CurrentShowPosition
	Else
		CurrentSlide = application.Windows(1).Selection.SlideRange.SlideNumber
	End If
End Function

Function TotalSection()
	TotalSection = application.ActivePresentation.SectionProperties.Count
End Function

Function SectionInformation()
	Dim maxSlide, minSlide, totalSlide, hiddenSlide
	Dim slideIndexInSection, slideIndex, currentSlideNumber, currentSectionNumber
	maxSlide = application.ActivePresentation.Slides.Count
	minSlide = 1
	
	totalSlide = 0
	hiddenSlide = 0
	slideIndexInSection = 0
	slideIndex = 0
	currentSlideNumber = CurrentSlide()
	currentSectionNumber = CurrentSection()
	
	While minSlide <= maxSlide
		Dim SectionIndex, isHidden
		SectionIndex = application.ActivePresentation.Slides(minSlide).SectionIndex
		isHidden = application.ActivePresentation.Slides(minSlide).SlideShowTransition.Hidden
		
		If currentSectionNumber = SectionIndex Then
			If isHidden Then
				hiddenSlide = hiddenSlide + 1
			End If
			
			If isHidden = False And minSlide <= currentSlideNumber Then
				slideIndexInSection = slideIndexInSection + 1
			End If
			
			totalSlide = totalSlide + 1
		End If
		
		If isHidden = False And minSlide <= currentSlideNumber Then
			slideIndex = slideIndex + 1
		End If
		
		minSlide = minSlide + 1
	Wend
	
	If TotalSection() <= 0 Then
		currentSectionNumber = 0
	End If
	
	SectionInformation = "elgato" & currentSlideNumber & "," & currentSectionNumber & "," & slideIndex & "," & slideIndexInSection & "," & totalSlide - hiddenSlide & "elgato"
End Function

WScript.StdOut.WriteLine SectionInformation()