<pre>on documentStack  put space into bNums  answer file "Document which stack ?" of type STAK  if it is empty then exit documentStack else put it into stackName  toComputer  push cd  go to stack stackName  put the number of cds into cardCount    repeat with cardNumber=1 to cardCount    go to cd cardNumber    put "Document" && stackName && cardNumber into fn    open file fn    write "Documentation for cd" && quote & cardNumber & quote    && "of stack" && quote & stackName & quote & return to file fn    write the date && the time & return to file fn    write "=========================================" & return to file fn        put the number of btns into bt    write "Card Buttons:" && bt & return & return to file fn    repeat with i=1 to bt      write "Name      :" && the name of btn i & return to file fn      write "Number    :" && the number of btn i & return to file fn      write "ID        :" && the id of btn i & return to file fn      write "Style     :" && the style of btn i & return to file fn      write "Rect      :" && the rect of btn i & return to file fn      write "Location  :" && the loc of btn i & return to file fn      write "Icon      :" && the icon of btn i & return to file fn      write "ShowName  :" && the showName of btn i & return to file fn      write "Hilite    :" && the hilite of btn i & return to file fn      write "AutoHilite:" && the autoHilite of btn i & return to file fn      write "Visible   :" && the visible of btn i & return to file fn      write "TextAlign :" && the textAlign of btnbtn i & return to file fn      write "TextFont  :" && the textFont of btn i & return to file fn      write "TextSize  :" && the textSize of btn i & return to file fn      write "TextStyle :" && the textStyle of btn i & return to file fn      write "TextHeight:" && the textHeight of btn i & return to file fn      if the script of btn i <> empty then        write return & "BTN SCRIPT:" & return to file fn        write the script of btn i to file fn        write return to file fn      end if      if i<bt then        write return to file fn        write "-----------------------------------------" to file fn        write return & return to file fn      end if    end repeat        write "=========================================" & return to file fn    put the number of bg btns into bt    write "Bg Buttons:" && bt & return & return to file fn    repeat with i=1 to bt      write "Name      :" && the name of bg btn i & return to file fn      write "Number    :" && the number of bg btn i & return to file fn      write "ID        :" && the id of bg btn i & return to file fn      write "Style     :" && the style of bg btn i & return to file fn      write "Rect      :" && the rect of bg btn i & return to file fn      write "Location  :" && the loc of bg btn i & return to file fn      write "Icon      :" && the icon of bg btn i & return to file fn      write "ShowName  :" && the showName of bg btn i & return to file fn      write "Hilite    :" && the hilite of bg btn i & return to file fn      write "AutoHilite:" && the autoHilite of bg btn i & return to file fn      write "Visible   :" && the visible of bg btn i & return to file fn      write "TextAlign :" && the textAlign of bg btn i & return to file fn      write "TextFont  :" && the textFont of bg btn i & return to file fn      write "TextSize  :" && the textSize of bg btn i & return to file fn      write "TextStyle :" && the textStyle of bg btn i & return to file fn      write "TextHeight:" && the textHeight of bg btn i & return to file fn      if the script of bg btn i <>empty then        write return & "BTN SCRIPT:" & return to file fn        write the script of bg btn i to file fn        write return to file fn      end if      if i<bt then        write return to file fn        write "-----------------------------------------" to file fn        write return & return to file fn      end if    end repeat        write "=========================================" & return to file fn    put the number of cd flds into bt    write "Card Fields:" && bt & return & return to file fn    repeat with i=1 to bt      write "Name       :" && the name of cd fld i & return to file fn      write "Number     :" && the number of cd fld i & return to file fn      write "ID         :" && the id of cd fld i & return to file fn      write "Style      :" && the style of cd fld i & return to file fn      write "Rect       :" && the rect of cd fld i & return to file fn      write "Location   :" && the loc of cd fld i & return to file fn      write "ShowLines  :" && the showLines of cd fld i & return to file fn      write "WideMargins:" && the wideMargins of cd fld i & return to file fn      write "LockText   :" && the lockText of cd fld i & return to file fn      write "Visible    :" && the visible of cd fld i & return to file fn      write "TextAlign  :" && the textAlign of cd fld i & return to file fn      write "TextFont   :" && the textFont of cd fld i & return to file fn      write "TextSize   :" && the textSize of cd fld i & return to file fn      write "TextStyle  :" && the textStyle of cd fld i & return to file fn      write "TextHeight :" && the textHeight of cd fld i & return to file fn      if the script of cd fld i <> empty then        write return & "FIELD SCRIPT:" & return to file fn        write the script of cd fld i to file fn        write return to file fn      end if      if i<bt then        write return to file fn        write "-----------------------------------------" to file fn        write return & return to file fn      end if    end repeat        write "=========================================" & return to file fn    put the number of flds into bt    write "Bg Fields:" && bt & return & return to file fn    repeat with i=1 to bt      write "Name       :" && the name of fld i & return to file fn      write "Number     :" && the number of fld i & return to file fn      write "ID         :" && the id of fld i & return to file fn      write "Style      :" && the style of fld i & return to file fn      write "Rect       :" && the rect of fld i & return to file fn      write "Location   :" && the loc of fld i & return to file fn      write "ShowLines  :" && the showLines of fld i & return to file fn      write "WideMargins:" && the wideMargins of fld i & return to file fn      write "LockText   :" && the lockText of fld i & return to file fn      write "Visible    :" && the visible of fld i & return to file fn      write "TextAlign  :" && the textAlign of fld i & return to file fn      write "TextFont   :" && the textFont of fld i & return to file fn      write "TextSize   :" && the textSize of fld i & return to file fn      write "TextStyle  :" && the textStyle of fld i & return to file fn      write "TextHeight :" && the textHeight of fld i & return to file fn      if the script of fld i <> empty then        write return & "FIELD SCRIPT:" & return to file fn        write the script of fld i to file fn        write return to file fn      end if      if i<bt then        write return to file fn        write "-----------------------------------------" to file fn        write return & return to file fn      end if    end repeat        write "=========================================" & return to file fn    write "Card properties" & return to file fn    write "Name       :" && the name of this cd & return to file fn    write "Number     :" && the number of this cd & return to file fn    write "ID         :" && the id of this cd & return to file fn    if the script of this cd <> empty then      write return & "CARD SCRIPT:" & return to file fn      write the script of this cd to file fn      write return to file fn    end if        write "=========================================" & return to file fn    write "Bg properties" & return to file fn    write "Name       :" && the name of this bg & return to file fn    write "Number     :" && the number of this bg & return to file fn    write "ID         :" && the id of this bg & return to file fn    if the script of this bg <> empty then      put the number of this bg into bNum      put the number of items of bNums into nItems      repeat with k=1 to nItems+1        if bNum=item k of bNums then exit repeat      end repeat      if k=nItems+1 then        put bNum into item k of bNums        write return & "BG SCRIPT:" & return to file fn        write the script of this bg to file fn        write return to file fn      else        write return & "BG SCRIPT: Same as in prior card" & return to file fn      end if    end if        write "=========================================" & return to file fn    write "=========================================" & return to file fn    close file fn      end repeat  pop cd  answer "Results put into " & stackName & "..."end documentStack</pre>