Try a repeat loop with a value that changes every iteration until the value reaches a certain number.
Sample code is below.
set x to 0
repeat
set y to x + 1
set x to y
display dialog "Iteration " & x buttons {"Cancel", "Continue"} default button 2
if x is 10 then
exit repeat
end if
end repeat
Replace the [address] in the “do shell script” thingamajig with this:
" & [variable name] & "
There’s a space after the second quotation mark, but with the way the board software formats posts, it always deletes such “mistakes”. I wish there were a way to disable that…
However, if you want to do all that within a single “do shell script” line, I’m afraid I can’t help you. SSH doesn’t support such things.