Macro for margins

Hey y'all, 

Would there would be a way for me to make a macro that creates 1 cm margins? I'm aware of the "/tools/options/presets/one centimeter margin" thing, but I'd like the margins to be created with one click, and not having to change the Units to centimeters every time (I usually prefer working with pixels).

Help anyone? 

oh and it's my first time here hehe.