Following up on the other imposition question, I'm trying to make an example file that shows an imposition schema according to command line arguments.

This way it works for the number of pages, as used in \dorecurse{\Pages}{…}, but not for the imposition schema. Typesetting \Schema looks right, but \setuparranging doesn’t work. Where's my error?

\def\Schema{\doifelsedocumentargument{schema}{\getdocumentargument{schema}}{1*8}}
\def\Pages{\doifelsedocumentargument{numberofpages}{\getdocumentargument{numberofpages}}{16}}

\setuparranging[\Schema]

Find the full example attached, I call it like

context --autopdf=auto --arrange impositiontest.tex --schema=TRYPTICHON --numberofpages=32

Hraban