Setting Action in Outliner from console and from script

I am trying to export all animations to file using a revised Export to DirectX script…
I would like to iterate through the animations within bpy.data.actions(easily done) and set the action as the current action for the scene, and while set, write the fcurves to file for each object(this part is done by current dx eport script)…

I am having trouble setting the current action…what are the bpy.ops.outliner.animdata_operation() parameters? From the following code I get an error message saying that ‘SET_ACT’ is not within the enumeration…

bpy.ops.outliner.animdata_operation(‘SET_ACT’)

How do I designate the act to be set?

Here’s a little example i used for an exporter:

# Ensure there's animation_dataif not thearmature.animation_data:
    thearmature.animation_data_create()


# Keep original action in mind (if animation_data was just created, action will be None)
orig_action = thearmature.animation_data.action


# Find armature-related actions
for action in bpy.data.actions:
    for fcurve in action.fcurves:
        if fcurve.data_path.startswith("pose.bones"):
            print("found pose.bones fcurve")
                break
    else:
        print("Skipped action %s, 'cause it has no Armature-related transforms" % action.name)
        continue




    thearmature.animation_data.action = arm_action


    # Export here
    
    # Restore action
    thearmature.animation_data.action = orig_action