Harlowe does not currently have a documented Macro API, so you are not able to create custom macros.
Depending on what you are trying to do you may be able to use Javascript and/or a <script> element to achieve the result. Harlowe does not currently have a documented Javascript API so access to it's internals is very limited.
If the new macro you wish to create is generic, if you believe other authors would also benefit it's existence, then I suggest adding a new issue on the Harlowe project website requesting it's inclusion.
Comments
Depending on what you are trying to do you may be able to use Javascript and/or a <script> element to achieve the result. Harlowe does not currently have a documented Javascript API so access to it's internals is very limited.
If the new macro you wish to create is generic, if you believe other authors would also benefit it's existence, then I suggest adding a new issue on the Harlowe project website requesting it's inclusion.