What is the macro syntax, please?

I am totally new to Linux and LibreOffice.

I am running LibreOffice version 6.0.7.3 on Linux Mint 19.3 Cinnamon, and also LibreOffice Vanilla for Mac version 7.0.4.4 on Mac OS 11.0.1 Big Sur.

I have an Epson WF-3540 printer that has two paper trays; number 1 that LibreOffice refers to as “Main”, and number 2 that it refers to as “Alternate”. I use number 1 tray for several sizes of paper; A4, A5, A6 and even envelopes, whereas I use number 2 tray for A4 only.

I need to create a print macro that specifies which tray to take the paper from, and the quality of the print ie Standard or High. The two documents will, invariably, be of different sizes. When being produced in “Writer” the two documents will be separate files, but when being produced in “Calc” the two documents will ideally be on the same worksheet ie two print areas. If absolutely necessary they could be on two worksheets, but I would prefer just one.

I tried to Record the macro but to no avail; it neither specified which tray or print quality. Would someone, please, help me with the macro syntax?

Having done that, how do I assign the macro to a button, please?

Don’t understand.
If you want to explicitly assign different paper trays to pages, you can do this via the setting for the PageStyle.
(Tab Page >> dropdown behind Paper tray:)

for the second half of your question re macro > button see: