For a Slideshow object named Slideshow 1, use the following syntax:
var numSlides = Slideshow_1.GetSlideCount()
Note:
In this example, the variable numSlides contains the number of slides in Slideshow 1. This value can be displayed in a Page or Publication variable on the current page of the publication.