Reuse Shared Actions in other Projects - Captivate 7 vs. 8

Intro

A while ago I started a sequence of tutorials about shared actions in Captivate 7: I promised then to explain how you can reuse the actions in another project. And then Captivate 8 appeared with a considerable improvement of shared actions: variables and literals are now candidate parameters. In my last article I explained the difference and consequences of this extension. And the examples I showed in my review of Features of Captivate 8, which were not possible to realize only with shared actions in Captivate 7 prove the value of that improvement.
Advantages of using shared actions (both in 7/8) within same project:
  1. Saving time: you don't have to create a new name as for a duplicated advanced action, just choose the parameter(s)
  2. Managing shared actions is in the Library, not in a separate dialog box
  3. Since you are using the same shared action over and over again, this helps keeping file size down
The real power of shared actions is even more apparent when you start to reuse them in other projects. You only have to get them in a new project, and you can use the shared actions like you did in the original project. Of course, you'll have to create the objects that have been used as parameters. Captivate 7 users will not be able to use variables, nor literals as parameters. For Captivate 8 users have a close look at the tips at the end of this article. Let us start with the different work flows that can be used to get shared actions from one project to another one. 

Getting shared actions in another project

1. Using Export/Import (7 - 8)

Similar to other Library assets, you can export shared actions from the Library and import them in another project. Use the small icons in the top bar of the Library:

The extension of those small exported files is cpaa. When they are imported in another project:

  • They appear in the Library of that project, with a Usage of 0

  • If the shared actions do use variables that are not defined as parameters, those variables will be created in the project to which you imported the shared actions.

2. Copy/Paste from External Library (7-8)

This is my preferred work flow. I love keeping much used assets in a separate project file, that I use as External Library:

  • Project file that you want to use as Library has to be closed

  • Use File, Import, External Library and point to the project file

  • Copy/paste the shared actions to the Library of the active project fie.

The results will be the same as with the first method, but you don't have to bother about saving the exported files somewhere and importing them from that same location. 

CP8 tip:

If you are using the default UI, not the Expert mode, this External Library will open as a Floating panel. This means that you can drag it wherever you want, increase its size etc. That functionality is available in CP8 for the normal panels only when you choose for Expert mode. 

3. Drag from External Library (8)

These work flows are not possible in Captivate 7.
You can drag shared actions from the external Library to the present project Library, alternative for Copy/Paste/
But you can also drag a shared action from the External Library directly on:
  • a slide: in that case it will be associated with the On Enter event, and you can immediately choose the parameter
  • an interactive object (button, click box, shape button...): in that case the shared action will be associated with the On Success event of the interactive object.
At the same time the Shared action will appear in the Library, but since it is immediately used, there will be a Usage of 1. If the shared action has variables that are not defined as parameters, they will be created in the project file. 
Dragging from the library on a slide or an interactive object is also possible from the present library of course.

Tips and Tricks for Captivate 8 users

1. Warning about dragging from External Library on event

If you have several shared actions that use the same variable, do not drag them on slides or interactive objects. There is a small bug (hopefully will be removed soon): if you drag them one by one to an event (on slide or object), before those shared actions are in the present Library, the variable will be created as many times as you execute a drag action. And each variable will have another name, which can be disturbing the logic of your shared actions.

Example: 

In the Dashboard use case, described in Features of Captivate 8 the variable v_counter is used in two shared actions, and one advanced action:

If you drag the shared action FirstViewBt from an External Library to a new project (like the last movie in the same article), not to the Library but immediately on one of the buttons used on the first dashboard visit, the variable v_counter - not defined as a parameter - will be created. If you do the same with the shared action NextViewBt, it will not use the created variable v_counter, but a second variable v_counter1 will be created. This will cause problems: not only will the number of visits not be updated as expected, but the Advanced action, ResetStart, will only reset the variable v_counter, not the second one v_counter1

To avoid this kind of problems: drag the shared actions (all at once is possible) from the External Library to the present Library (Usage will be 0), and drag them from that Library onto events.

2. Choosing variables as parameters

In Captivate 8, variables and literals don't have to be parameters, they are only candidates. You can easily choose a variable to be a parameter in one shared action, and not in another one. 

Example: 

For the Dashboard use case, the variables v_ch1, v_ch2, v_ch3 and v_ch4 are:

  • defined as parameters both in the shared actions FirstViewBt and NextViewBt because they have to be edited when applied to another button

  • not defined as parameters for the shared action EnterDash, because they have never to be edited.
When dragging (or copy/paste) the shared actions from the External Library to the present project Library, this saved time because I didn't have to define the variables, they were imported with EnterDash. I could use them right away as parameters in the two other shared actions.

3. Careful with literals as parameters

In some rare use cases it can be interesting to define a literal as a parameter. I want to warn however: if you define a literal of 1 as a parameter and that number appears several times in the shared action, all the literals will be changed to the value you give when entering the parameter value. 

Examples

QuizMessage: a conditional action with 4 decisions, that shows a different item/group based on the obtained percentage for a Quiz. In this case it can be useful to define the limiting scores as parameters:

Whereas in this case, it is not a good idea to define the '1' as a parameter, because it appears in two different lines, once in the condition itself and once in the Assign statement. Only when you can replace the Assign by a Toggle statement, you could define the literal as a parameter because in that case it would appear only in the condition:


Conclusion

As long as you can apply the shared action without having to edit a statement/condition, or to add/delete a line they can be a real time saver. But often editing is necessary, certainly in Captivate 7. For the Dashboard use case: if you do not have the same number of buttons on your dashboard, you have to edit the EnterDash action for sure.  And how do you manage shared actions? I will write another blog post in the near future on those subjects.




5 responses
Thanks a lot Lieve ! Shared experience for shared actions !
Thank you Lieve bitesize learning for all
Thanks Joanne.
Hi Lili I used your toggle show/hide button Advanced Action script on a widget and it would work perfectly except I need to hide the widgets to begin. I tried several variations but cannot get them hidden. Any suggestions?
Mary, if I understand your question well, you have the choice: either you put it by default to 'Invisible in Output', which will be the case when you start the course. Or you could use the On Enter event of the first slide to hide the widget.