Implement built-in macro feature (port to action_macro)