Every time you remove a file and inc the file-count %x, $findfile(dir,N) will not point at the next file but the file after the next file. The next file would be the file with the same number, as the "current" file with this number had been removed smile
To fix this, e.g. change your while loop to inc the number only if your (file != something)-condition is not met and the file has not been removed.

Code:
alias cut.files {
  var %x = 1
  while ($findfile($mircdir,test*,%x,1)) { 
    var %file = $qt($v1)
    if (%file != $qt($+($mircdir,testing.txt))) {
      copy -o %file $+($scriptdir,$nopath(%file))
      remove %file 
    }
    else { inc %x }
  }
}

Edit: Note that - now - this should pass all files correctly if you execute the copy/remove command, but will result in an infinite loop if you echo the command only.

Last edited by Horstl; 24/04/08 12:29 PM.