July 16, 2017
Create a List of All Your Slide Titles (Exporting a Table of Contents)
Comments
(3)
July 16, 2017
Create a List of All Your Slide Titles (Exporting a Table of Contents)
Joe Ganci is President of eLearningJoe, LLC, a custom learning company located outside Washington. D.C. Joe has been involved in every aspect of multimedia and learning development. He holds a degree in Computer Science and writes books and articles about eLearning. He is widely considered a guru for his expertise in eLearning development and technology, and he consults with clients worldwide, creating eLearning modules and templates, often training personnel in their use and then making himself available to assist if necessary. Of course, Joe and his team also create eLearning from start to finish, performing the proper analyses, design needs, the development of the learning and its implementation. Joe evaluates eLearning results, both for his own work and the work of others for his clients.                                                                                                                                                                                                                                                                                                                                                                                                                                          Joe is a Director with the International Association for Blended Learning (IABL), a nonprofit international organization whose goal is to promote the use of the best form of learning for each component of a learning curriculum across all industries and academia. This year he organized and ran the 24-Hour Conference IABL Online Conference.                                                                                                                                                                                                                                                                                                                                        Joe is also a frequent teacher and presenter online and at industry conferences and client sites (during times without a pandemic!) , especially on the subject of eLearning design and development tools. His tool reviews appear each month in Learning Solutions Magazine and he is the recipient of several awards and many letters of recommendation for his work in eLearning, including a Lifetime Achievement Award way back in 1999 and the second ever eLearning GuildMaster Award in 2013. His mission is to improve the quality of eLearning with practical approaches that work.
Guide 5 posts
Followers: 30 people
(3)

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:

2017-07-15 19_55_17-Get slide titles.cptx_ 2017-07-15 19_55_25-JavaScript

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.

    2017-07-15 19_56_36- 2017-07-15 19_56_55-

  • 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.
    2017-07-15 19_58_41-
  • In your Development Tools, go to the Console. Here you will see at least the first slide’s title listed.

2017-07-15 20_03_23-INDEX~1.HTM

  • 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.
    2017-07-15 20_04_33-INDEX~1.HTM
  • 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.

3 Comments
2017-07-17 07:46:04
2017-07-17 07:46:04

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

Like
(1)
>
zeeshan hussain
's comment
2017-07-18 19:40:37
2017-07-18 19:40:37
>
zeeshan hussain
's comment

Thanks, Zeeshan! Mine was quick and dirty. This is definitely more elegant!

Like
2017-07-16 10:50:52
2017-07-16 10:50:52

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?

Like
Add Comment