Using Shared Actions in Adobe Captivate

If you enjoy creating highly interactive e-learning, you’ll eventually notice there are a number of similar variables and advanced actions you seem to be creating all the time. Wouldn’t it be great if you could save these actions, export them as some kind of file, and then import them again into another project? That’s basically what Shared Actions are supposed to deliver and this article demonstrates how to create, saveexport, import, and execute shared actions in Adobe Captivate projects.

This feature was introduced in Adobe Captivate version 7. Unfortunately, there are no good workarounds for sharing advanced actions between project files in earlier versions of Captivate.  So, unless you are currently using Captivate version 7 or later, the information on this page will not be of much use to you.


About replicating actions and variables across Captivate projects

Ever since Adobe added Advanced Actions to Captivate's long list of features, e-learning developers have been disappointed to find there was no way to transport these actions from one project to another. They were forced to recreate the same sophisticated interactions again and again from scratch in each new CPTX project file.

It was certainly possible to create interactions using advanced actions in a CPTL template file and then use this template to spawn one or more other CPTX project files, thereby allowing the child projects to inherit any actions residing in the parent template. However, once you move from the template file to the CPTX file any changes to the original CPTL have no further effect on child projects. If you created an action that you wanted to use in all other modules of a given e-learning course, tou were again stuck with the job of rebuilding the actions from scratch within each module.

So as powerful as Captivate’s advanced actions may be, they have always suffered from this one big drawback. There was no easy way to export actions from one project file and import them into another. As a result, the ability to share actions between projects has been a standing feature request for years.

Articulate Storyline raises the bar

When Captivate’s main competitor Articulate Storyline first hit the market in 2011, it took a slightly different approach to interactivity which made it possible to copy an entire project slide containing objects events (known as 'triggers') and actions, and then paste this slide into another project as a fully functional chunk of interactivity. This enabled developers to build their own library of re-usable interaction slides to easily plug into other projects or share with other developers.

When compared head-to-head with Captivate's advanced actions, Storyline’s interactivity framework is not quite as powerful. But needless to say, its ability to copy and paste or share interactions across project files has been a highly-praised feature of Storyline from the day it was released.

Adobe strikes back in Captivate 7 with Shared Actions

Not satisfied to see their flagship e-learning authoring tool upstaged by a mere version 1 competitor, Adobe decided to strike back with Captivate 7 and finally plug this functionality gap by introducing Shared Actions, allowing advanced actions to be exported in a format that could be then imported into another project. Then with the update patch to Captivate 7.0.1 Adobe went one step further and made it possible to simply copy and paste entire slides between project files, with all objects, variables and advanced actions taken along for the ride. This is a huge leap forward for the Captivate product and I'll explain the procedure for copying and pasting slides with actions a little later in this article.

However, there are some areas where I feel shared actions could still be improved:

  • The approach taken feels very "programmer-centric" with some technical terms such as "parameters" that may seem a little intimidating for non-technical Captivate users.
  • After using shared actions a few times you’re left wondering if it would not have been quicker just to duplicate the existing action or copy/paste the slides instead.
  • And lastly, as I explain later in this article, the current implementation of Shared Actions has  far too many ‘gotchas’.

So it’s not a perfect solution, but at least it’s definitely a big step in the right direction.  My gut feeling at this point is that it might take another Captivate version or two before Shared Actions really become as useful as they should be.


Creating a new shared action

Basically, a shared action is like a template for advanced actions. You start by creating a standard action or conditional action, and then save it as a shared action.  Let’s see how this works:

  1. Open the Advanced Actions dialog (Project > Advanced Actions or SHIFT + F9).
  2. Open the Existing Actions list and find the specific standard or conditional action you want to save as a shared action. In the example shown below I’ve selected a fairly simple conditional action that sets a variable and hides or shows a couple of buttons on a slide.
  3. Click the Save As Shared Action button at the bottom of the dialog.


    The Save As Shared Action dialog opens. (Please note that this dialog is modal, which means you cannot interact with any other part of Captivate until you close the dialog again.
  4. The first thing you will notice is that the Shared Action Name is inherited from the parent action. Although shared actions are kept separate from standard and conditional actions, I still find it can get a bit confusing if they also share names. So I usually prefix my shared actions with the letters SA_ so that I can immediately tell them apart.
  5. In the Description: box, type a simple yet clear description of what this action does. (You may not remember the full purpose of the action in a year or two from now.)

  6. By default, the Parameter Name takes the Item Name of the current target object. For each listed Parameter, type a short description to indicate this object’s intended purpose. You can make the description as long as you want but only the first truncated line will appear. (To see the rest of the description, you just need to place your mouse cursor over the line.)
  7. Once you’ve completed all descriptions, click the Save button.

    Captivate immediately notifies you the shared action as been successfully saved and returns you to the Advanced Actions dialog showing the original action on which the new shared action was based.

    Any shared actions you create are immediately added to a special section in the project file’s Library. From here you can export and import shared actions to other projects.


By the way, this article is an excerpt from my: Infosemantics Guide to Adobe Captivate Advanced Actions e-book. Not only does this book offer more than 200 pages of essential information for Captivate developers, it also comes with the actual CPTX files I used for screenshots when writing the e-book. You can download and open these bonus files for Captivate versions 5, 6 and 7 to see exactly how the advanced actions and interactions I explain in the book are actually set up in a real project.


Exporting shared actions

Now that we’ve been able to create a shared action, let’s look at how to export it so that it becomes available in another project file:

  1. Open the Library tab and scroll down to the Shared Actions folder.
  2. There are two ways to perform the export:
    - Select one or more shared actions and click the Export  icon in the Library toolbar.
    - Right click the shared action and choose Export from the context menu.

  3. When the Save As dialog opens, navigate to a suitable folder and click the Save button.

    Each shared action is exported as a .cpaa file in the target folder location.

NOTE: Custom object effects are not exported in Shared Actions

For those of you that might have been thinking: "Great! I can just create custom object effects in an advanced action, save it as a shared action, export it as a .cpaa file, and then later import into another project." Think again. The inability to use custom object effects in shared actions is a limitation of the current implementation. The Captivate community should keep requesting Adobe to make enhancements to shared actions so that Captivate can continue to evolve.  If enough people ask for something, Adobe will usually listen.


Importing shared actions into another project

Once you have exported shared actions you can then import them to other Captivate project files (as long as the target files are Captivate 7 format or higher).

  1. Open the project file Library and scroll down to the Shared Actions folder.
  2. Click the Import  icon on the Library toolbar.
  3. When the Import dialog opens, navigate to the folder containing saved shared actions.
  4. Select one or more .cpaa shared action files and then click the Open button.


    Captivate notifies you of the number of shared actions that were successfully imported to the Library

    These will then appear listed there in the Shared Actions folder and will be available from the Advanced Actions dialog.

Importing actions from a shared Library

There is an alternate method of importing shared actions that can also be used to import other objects such as images, audio, and video files that currently reside in another project. This involves sharing project Libraries

Here’s how this technique works:

  1. Open the Library of the project where you want to import shared actions.
  2. Click the Open Library  icon on the Library toolbar.
  3. If you have previously opened the Library of another project file then this will already be shown listed. Otherwise, just navigate to the folder containing the project file that contains your desired shared actions and open it. (Please note that the CPTX file in question must not already be open in Captivate at the time.)
  4. When the Library of the source project open as a floating tab inside your current project, scroll down to the Shared Actions folder to select one or more actions.
  5. Hold down the mouse button to drag the selected actions and drop them into the Library of your current project file. 

    These will then appear listed there in the Shared Actions folder and will be available from the Advanced Actions dialog.

Create new advanced actions from a shared action

Once you have one or more shared actions available in your project file you can then use them to spawn new instances of the original standard or conditional action as follows:

  1. Open the Advanced Actions dialog again.
  2. Open the Create from: drop-down menu.
  3. Select the shared action you wish to use as a template to create a new action.
  4. When a new instance of the shared action is created the Action Name field is left blank. If you followed my suggestion of identifying the shared action with some kind of prefix, then in most cases you should be able to just remove this prefix again to create the new action name. Captivate will warn you if there is another action in the project with the same name.

  5. If any variables required by the original action are not present in the project they are automatically created. However, watch out for this next little gotcha. If variables with the same name are already present in the project, Captivate will create duplicate variables with a number appended to the end of the variable name.
  6. In the Actions grid, open the drop down list on each parameter placeholder and select an object from within the current project to replace it. There’s a potential gotcha here as well. See the section later in this article about the shared action parameter gotcha.

  7. Once your new action is complete, click the Save As Action button at the bottom of the dialog. Captivate notifies you when the script saves successfully.
  8. Your new action can now be executed by any run-time event.

Executing shared actions directly

You can also opt to use the Execute Shared Action command and any run-time event to launch a shared action directly. When would this be a good idea? Well, if you have a situation where you may need to use the same action several times with only slight changes to affected objects, then a shared action might save you some time. If you’d like to see a demonstration of this use case, watch this YouTube video by Adobe Evangelist Pooja Jaisingh.

The workflow is as follows:

  1. Make sure any desired shared actions are present in the project file. If not, either create them or import them from outside the project.
  2. Set a run-time event for a slide or interactive object to Execute Shared Action.
  3. Selected an action from those listed in the Shared Action: drop-down list underneath.

  4. Click the small {P} button to the right of the Shared Action field.
  5. When the Shared Action Parameters dialog opens, use the drop-downs to select target objects in this project file to which the shared action line items will be applied. (Note that this is the only case where you will see Parameter Descriptions displayed.)

  6. When all parameters are complete, click the Save button to close the dialog.
  7. Repeat the above steps for any other slide or event where you want to execute the same shared action. Each separate usage requires you to set the parameters again.

Pooja’s video demonstrates nicely how to use shared actions that apply Show, Hide and Apply Effect actions to a number of screen objects or even groups of objects. Adobe’s blog post about shared actions also tends to focus on using Show, Hide, and Apply Effect actions. At first glance shared actions may look impressive. However, you won't usually find any mention of the many shortcomings of Shared Actions. If you’d rather know about the gotchas before you encounter them, read on...I outline the downsides of using Shared Actions next.


The long list of Shared Action "gotchas"

The way shared actions are currently implemented makes them a less attractive option than they otherwise might have been. After reading the following, make up your own mind about using them.

Gotcha # 1 - To edit a shared action, delete and start again!

Once you create a shared action there’s no way to open it up again and make changes to its structure or component actions. Believe it or not, the only way to edit a shared action is to delete the existing one in the Library, create another standard or conditional action the way you want it to be, and then save this as a shared action under the same name as the one you just deleted.

If you think this workflow is somewhat 'convoluted', I agree with you.

Gotcha # 2 - Variables cannot be used as parameters

At the moment you can only set actions performed on slides or slide objects as parameters in a shared action. You cannot set variables as parameters. Yet, many (if not most) of the shared actions you create will involve system variables or user variables. Once you start using conditional actions you will definitely be using variables as part of condition statements in decision blocks, as well in action items where variables are assigned values.

For example, the standard action below has an action line item that assigns the value of a variable. If this were saved as a shared action only the second line item that jumps to a slide would be shown as a configurable parameter. The variable would be fixed and unchangeable.

If you watch Pooja’s YouTube video closely as she creates shared actions from existing actions, you will notice that at no time do any lines involving variables get turned into parameters. So if you wanted to use an action multiple times in a project, and each new instance required you to change anything related to the variables (e.g. which variable is being assigned, or what value is being assigned to it), then a shared action will not allow you to do that. In my view this is a major gotcha.

Adobe has indicated they are considering adding variable parameters in Captivate 8, but until then variables in shared action will remain set in stone.

Gotcha # 3 - Imported variables get duplicated

When you import a shared action to a different project, Captivate checks to see if that project already contains any existing variables of the same name. If it does not find the required variables, then these are automatically created and added to the Variables dialog. So far, so good, but the rest of the story is not so good.

It turns out that if the target project already has some variables that happen to have the same names as those of the imported shared action, Captivate rewrites the names of the incoming variables by appending a number to the end of their name, and then adds these new variables to the list.

The result is the mess of duplicated variables shown above. The only way to clean up this mess is to go through your shared actions and point them back to the original non-appended variable.

But wait, have you forgotten about gotcha # 1 above? You cannot edit shared actions. Doh!

Gotcha # 4 - Parameter descriptions only show for Execute Shared Action

Parameters are what make shared actions transportable from one project to another. They are essentially placeholders standing in for the slide objects that will be targeted with actions when the shared action is used on a different slide, either in the same project or even a totally different project.

At the time you create the shared action Captivate forces you to write descriptions for each parameter, which might make you think these descriptions will be visible as a guide when you convert these shared actions back into standard or conditional actions. Indeed, the Adobe Help files recommend "appropriate descriptions for the shared action and parameters to help you easily identify them when you want to reuse". This would be the case, if you could see the descriptions again.  But you cannot.

Unfortunately, the only time parameter descriptions will again be visible is when using Execute Shared Action as a single action. Only then does the dialog box show your carefully written text.  So it begs the question, why waste all this effort?

Conversely, when using a shared action to create another action, the parameter descriptions are nowhere to be found. They’re not even used as tooltips or help text. All you see are blank grey drop-downs that allow you to select objects, without really knowing why. After trying to create and use shared actions a few times you’ll find it feels a lot like flying blind. So, before creating your shared actions I recommend you make notes or take screenshots of the parent action line items as a guide for when it comes time to write your description.

Recommendations about using shared actions

So, are shared actions really useful; or more trouble than they’re worth? For my money...Within a project file, I don’t bother using shared actions, I just duplicate the existing actions to create the ones I need.

If you need to use the same action repeatedly within the same CPTX file, and there are no changes required each time you reuse the action, just use the same action each time. You would be mad to use a shared action and have to set up the parameter targets each time.

If you need to repeatedly re-use an action in the same project, with only minor changes each time, then I believe you are better off duplicating the action and just modifying the duplicates.

Consider the following:

  • Duplicating an existing action involves a click on the Duplicate Action icon, typing a new name, making any required changes to line items, click Save and you’re done. Finished.
  • Using a shared action also involves opening an existing action, clicking the Save As Shared Action button, typing a name, entering parameter descriptions for each item that needs to change, then saving those changes, then creating new actions from the shared action, and changing the blank parameters to point to new slides or objects.

Which of the above seems easier to you? I personally prefer the first option.

Only export and import complex actions, but try copy/paste slides first.

For my money the only place shared actions might conceivably win over other options is when you have a requirement to export actions from one project to another. But now that Adobe has added the capability to copy and paste slides along with all referenced variables and actions with Captivate 7.0.1, this workflow would seem to be a far better solution than using shared actions.

The next section of this article explains this workflow. Check it out and then decide whether you still prefer exporting and importing shared actions.


How to copy and paste actions across projects

As mentioned at the beginning of this chapter, the Captivate 7.0.1 update patch introduced a wonderful enhancement that we developers have been wanting for years. I’m referring to being able to copy and paste objects or slides from one project to another and have all referenced variables and advanced actions also be replicated across to the target project file. This is going to be a huge time-saver for anyone that likes to create complex interactivity and needs to be able to transport it intact from one project to another.

However, there are some points to remember in order for the results to turn out as you expect. So pay particular attention to the following example:

  1. Let’s say I have a button on a slide with On Success event set to execute an advanced action called MyConditionalAction. This particular conditional action references two user variables called MyVariable and MyOtherVariable and executes a Show action to unhide the hidden caption above it. (See the screenshot below.)
  2. Note what happens in each of the following scenarios:
    • If I just copy the button by itself, and then paste it into another project file, the button and the two variables arrive, but the advanced action or the text caption do not. The button’s On Success action is set to Continue.
    • If I copy both the button and the text caption together, then paste them into the other project file, the advanced action as well as all variables arrive safely, with the button’s On Success action set exactly as you see it above.
    • If I copy and paste this entire slide from one project to another, then all objects on the slide (including the caption and button) as well as all variables and actions referenced by the button are replicated in the target project (as shown below)

Rules for copying and pasting advanced actions with variables

So what are the rules governing this behavior? Well, the secret to success in copying and pasting advanced actions from one project to another is to make sure all objects referenced by those actions are also copied over to the new location at the same time. Otherwise the advanced actions will not arrive at the destination. Oddly enough, referenced variables will be copied over, but not the advanced actions.

This principle extends even further. If you are trying to transport an advanced action that references more than one slide (perhaps because it is executed on one slide but contains an action to jump to a different slide), then all referenced slides must be copied over to the new location at the same time, otherwise the advanced action gets removed during the operation. The more complex your interaction becomes, the more slides you may need to copy in order to replicate your advanced actions in the new project location.

Either way, this is still a huge leap forward for e-learning authors the world over and I congratulate the Adobe Captivate development team on pulling off this sizeable miracle of software engineering.

IF YOU LIKE WHAT YOU'VE READ ABOVE, THERE'S PLENTY MORE!

Join more than 2500 other Adobe Captivate users just like yourself and receive regular troubleshooting tips, illustrated tutorials, technical information, and creative solutions to real-world e-learning development issues. (See an example here.) Click the button below to join our community.  It's completely FREE!