A simple macro for the spawn command is simple, just click on / and everything will be written for you, you can disable it on the same button / Universal macro for both minecraft java and minecraft bedrock
Download the program (Download) and go to the macro editor
press the button «Open file»
and select the downloaded file
assign a macro to a key and run the program