<pre>on splitStack destStackPath  if destStackPath is empty then    put "splitStack destStackPath"    exit splitStack  end if  toComputer  put the number of cds div 2 into theLastCard  repeat with x = theLastCard down to 1    put x    go to cd x    doMenu "Cut card"    push cd    go to last cd of stack destStackPath    doMenu "Paste card"    if x = 1 then doMenu "Compact stack"    pop cd  end repeat  doMenu "Compact stack"  beep 2end splitStack</pre>