Skip to main content
Legend
August 27, 2026
Answered

New Captivate: Any way to jump to an arbitrary slide using the JavaScript API?

  • August 27, 2026
  • 3 replies
  • 57 views

I’m trying to figure out how to dynamically jump to a slide using the JavaScript API. There is a “Go to slide” action, but that can only handle hard-coded destinations.

cpAPIInterface has an undocumented method, “goToSlide”, used by the aforementioned “Go to slide” action, but it appears to not be intended for developer use. For example adding an action to go to slide 3 of a project results in the code “cp.goToSlide(1526, 780)” being generated. That seems almost deliberately cryptic.

I find it hard to believe that such basic functionality as jumping to a slide is missing from the API. This is essential for any sort of dynamic branching applications.

    Correct answer ClayUUID

    Update: I was wrong, goToSlide() does work. Turns out there are two versions of this function with the exact same name. The version that takes two mystery arguments is generated for internal use when you add a “Go to slide” action. The version that exists as a cpAPIInterface method is a completely different function that takes only one argument, which I eventually figured out is a slide label. And it works! For example, calling cpAPIInterface.goToSlide("Comparison 3") will immediately load that slide.

    But what if you need to jump around by slide number instead? Simple, just extract the project’s TOC metadata at runtime and build an array of all the slide labels:

    var toc = JSON.parse(cp.model.data.tocProperties.tocProperties).tocConfig.slideDetails;
    var slideLabels = [];
    for (var rec of toc) {
    slideLabels.push(rec.label);
    }

    I did notice that each record in the TOC has an “isVisible” property. I have no idea under what conditions a slide might become not-visible, nor if that would affect slide indexing, but it might be something you’d have to account for depending on what you’re doing.

    Anyway, with the label array built, jumping by slide number can be done like so:

    cpAPIInterface.goToSlide(slideLabels[destSlide - 1]);

    The - 1 because Captivate slide numbering is 1-based rather than 0-based. Or you could get rid of the subtraction by initializing the labels array to [""] instead of [] so the 0 slot would be unused.

    Now everybody start using this so Adobe can’t remove it.

    3 replies

    ClayUUIDAuthorCorrect answer
    Legend
    September 29, 2026

    Update: I was wrong, goToSlide() does work. Turns out there are two versions of this function with the exact same name. The version that takes two mystery arguments is generated for internal use when you add a “Go to slide” action. The version that exists as a cpAPIInterface method is a completely different function that takes only one argument, which I eventually figured out is a slide label. And it works! For example, calling cpAPIInterface.goToSlide("Comparison 3") will immediately load that slide.

    But what if you need to jump around by slide number instead? Simple, just extract the project’s TOC metadata at runtime and build an array of all the slide labels:

    var toc = JSON.parse(cp.model.data.tocProperties.tocProperties).tocConfig.slideDetails;
    var slideLabels = [];
    for (var rec of toc) {
    slideLabels.push(rec.label);
    }

    I did notice that each record in the TOC has an “isVisible” property. I have no idea under what conditions a slide might become not-visible, nor if that would affect slide indexing, but it might be something you’d have to account for depending on what you’re doing.

    Anyway, with the label array built, jumping by slide number can be done like so:

    cpAPIInterface.goToSlide(slideLabels[destSlide - 1]);

    The - 1 because Captivate slide numbering is 1-based rather than 0-based. Or you could get rid of the subtraction by initializing the labels array to [""] instead of [] so the 0 slot would be unused.

    Now everybody start using this so Adobe can’t remove it.

    Participant
    September 11, 2026

    Completely agree—hard-coded jump limitations are frustrating! Adobe Captivate's internal slide indexing can feel needlessly cryptic, making custom `cpAPIInterface` wrappers essential for building truly dynamic, flexible branching logic. MyAARPMedicare login

    ClayUUIDAuthor
    Legend
    September 9, 2026

    Well, I wasn’t able to find any “proper” way for user scripts to do slide jumping, so I ended up resorting to an ugly but functional hack-- just issue multiple consecutive next() or previous() commands as needed to reach the desired slide. Seems to work so far. 

    I used a similar trick to implement slide replay. Go the next (or previous) slide, then immediately come back. This one does require that there be at least two slides in the project.