Distribute on X axis MACRO

I want to _distribute objects on the XAxis (without selecting from command line), and I want to always be able to specify the distance between the objects in the command line. Mode=Gap is ok (this macro should work both with pre selected and not preselected objects)

This is where I reached:

! -Distribute _Pause Spacing=_Pause

I tried adding the XAxis option in the macro, I can’t make it to work. I did some macros in the past, and I managed to make them all work to my need but this one I am missing something…

Try:

!_-Distribute _Pause _Spacing=_Distance _Pause _Pause _XAxis _Enter

thank you for your macro but… still I need to click on XAxis manually to complete it…

Ah, I assumed you wanted to click. Take the third _Pause out of it and it should be fine for keyboard gap distance input. The third pause helps when clicking.

Nailed it! thank you

!_-Distribute _Pause _Spacing=_Distance _Pause _XAxis _Enter