Earlier today, I saw this discussion:
https://elearning.adobe.com/discussion/2358002/
In essence, ruthg84 needs to get a list of all the slide titles in several of her files. I responded on that thread but am showing my solution here too because I can include screen shots here.
I took a quick stab at this and have created a solution that works, though it takes a couple of steps. I hope others of you may find a quicker way, but this works and doesn’t take long.
- In the first slide of your Captivate file, set the On Enter action to Execute JavaScript and enter this in the JavaScript window:
var titles = ”;
var title = ”;
window.cpAPIEventEmitter.addEventListener(‘CPAPI_SLIDEENTER’,
function() {
titles = titles + ‘Slide ‘ + window.cpAPIInterface.getVariableValue(‘cpInfoCurrentSlide’) + ‘: ‘;
title = window.cpAPIInterface.getVariableValue(‘cpInfoCurrentSlideLabel’);
if (title == ”) { titles += ‘(No slide title)’} else {titles += title };
titles += ”;
console.log(titles);
}
);
- Make sure in your Skin Editor that your playbar is turned on and the Next button is available.
- Publish your file (Preview won’t work). I tried it in HTML5 but Flash should work too.
- Launch your published file in the browser.
- Turn on your Development Tools in your browser. In Chrome, you can do this by hitting Ctrl+Shift+I or going to the browser’s options and turning it on there.
- In your Development Tools, go to the Console. Here you will see at least the first slide’s title listed.
- Use your Playbar Next button and go to each screen, quickly if you like, just as most learners do (haha). There is no need to wait for the slide to finish.
- Each time you hit the Next button, you’ll see in the Console the current slide title added. If a slide does not have a title, the words (No slide title) are added.
- When you get to the last slide, copy the last console line and paste it into a text editor or into Word.
- Find and replace each occurrence of @@ with a carriage return.
- Now you have a complete list.
Example: I tried this with a file I created in which there are six slides. After I got to the sixth slide after publishing, I copied this out of the Console window:
Slide 1: Introduction@@Slide 2: Hello There@@Slide 3: (No slide title)@@Slide 4: Slide Four@@Slide 5: Test@@Slide 6: Summary@@
I copied the line into a text editor (Word would work too) and after replacing all @@ with a carriage return, now have a nice list:
Slide 1: Introduction
Slide 2: Hello There
Slide 3: (No slide title)
Slide 4: Slide Four
Slide 5: Test
Slide 6: Summary
I hope this helps anyone who needs to make a quick list of all slide titles.
Hi Joe,
Adding below code works fine for me:
var titles;
var title;
window.cpAPIEventEmitter.addEventListener(‘CPAPI_SLIDEENTER’,
function() {
titles = titles + ‘Slide ‘ + window.cpAPIInterface.getVariableValue(‘cpInfoCurrentSlide’) + ‘: ‘;
title = window.cpAPIInterface.getVariableValue(‘cpInfoCurrentSlideLabel’);
if (title == ”) {
titles += ‘(No slide title)’;
}
else
{
titles += title;
}
titles +=”;
console.log(titles);
window.cpAPIInterface.next();
}
);
Please note that i have added window.cpAPIInterface.next(); within the eventListener function.
Regards,
Zeeshan
Thanks, Zeeshan! Mine was quick and dirty. This is definitely more elegant!
By the way, I tried to automate the process a bit further by using
window.cpAPIInterface.next();
with and without
window.cpAPIInterface.play();
but that didn’t work. I know that in Captivate itself, the options for Go to the Next Slide and other navigation actions are not available when setting the On Enter action for a slide, so that may be the reason. Is it because technically it’s not something that can be done or is it because it didn’t occur to anyone on the engineering team at the time why anyone would ever want to do this? If the latter, this is an example of where sometimes it’s better to leave options open even if there doesn’t seem to be a good reason why. Can Adobe confirm if this is the reason that the next and play methods wouldn’t work when I tried them?