See the Command Editor page for a description of the elements which the Simple and Advanced modes have in common. This page only covers things unique to the Advanced mode.
While the Simple 
mode only lets you define single-line functions, Advanced mode lets you 
create more complex ones. From Simple mode, click the Advanced 
button to switch to Advanced mode. The command editor will also switch to 
Advanced mode automatically if the button you are editing already contains a 
function with more than one line. In the Advanced mode the single line 
Function field is replaced by a multiple-line text box that 
lets you create more complicated, multiple-line functions.
 
 
This screenshot shows the command editor when it is in Advanced mode (the 
function shown is from Copy Files button on the default 
toolbar). You can see that the single-line Function field has 
been replaced with a multiple-line field. There is a new drop-down which lets 
you select the type of the function (Standard or MS-DOS 
Batch). Also, the Start in and Run 
fields have disappeared - if they had been specified in Simple 
mode, they will be replaced by equivalent commands in the multi-line 
function definition. (Not to be confused with the Run button, 
which is discussed below.)
 
     
 
In these screenshots you can see that the Start in field 
has been converted to a cd command (to set the 
current directory) and the Run 
setting has been converted to a @runmode modifier. 
There are a number of command modifiers that you can use for commands in 
Advanced mode. Another one is shown above: in the Copy File 
function, the @keydown modifier is used to change the 
button's function based on whether the Shift key is held down 
or not. See the Command 
modifiers page for more information on modifiers.
The Function drop-down in Advanced mode lets you select from three types of functions:
The multi-line text field is where you enter the instructions that make up the command. The toolbar along the top of the field contains a number of drop-downs that can help you build up the command:
Lines beginning with // are ignored, allowing you to put comments in your commands. The // must be at the very start of the line, with no spaces or anything else before it, for the line to become a comment.
The Run button at the bottom of the dialog allows you to instantly run your command or script to test it out without having to close the button editor. You can use the F5 hotkey to do the same thing. (When working on something complex, it's still a good idea to save your work occasionally, just in case! Saving only happens when you click OK in the button editor and then OK again in the Customize dialog to exit Customize mode.)
Buttons run from the editor will be run against the source folder tab in the lister which launched the editor. If your button requires selected files, you will probably find it useful to add the @nodeselect modifier on a line near the top of the command to prevent the selection being cleared each time you test the button. Depending on the type of button, you may or may not want to leave the modifier there once you are finished. When writing a script, you can do a similar thing using the Command object's deselect property, and the default script you get when entering script mode shows you an example of how to use it.
Test-running a script will also cause an output panel to open at the bottom of the editor where any error messages or strings passed to the DOpus.Output method will appear. These will also appear in the Script Log if you have it turned on in the lister.