stateful actioni

@asermax - re setting the state of the action.

enc works for RB2.99.  I havent had time to test on rb2.96 - please can you check?

cheers.