For a dialog editbox:

Code:
var %i = 1
while ($did(<dialog>,<id>,%i) != $null) {
  clipboard -an $v1
  inc %i
}