<pre>on replaceString findString,replaceString  push cd  put 0 into msg box  doNothing  -- ie. set the result to empty  repeat until the result is not empty    find whole findString    if the foundChunk is not empty then      put replaceString into the foundChunk      add 1 to msg box    end if  end repeat  pop cd  beep 2end replaceStringon replaceString  ---  global scriptFindString  ask "String to find :" with scriptFindString  if the result is "cancel" or it is empty then return "Operation annulee" else put it into scriptFindString  ---  global scriptReplaceString  ask "Replace string :" && quote & scriptFindString & quote && "with :" with scriptReplaceString  if the result is "cancel" or it is empty then return "Operation annulee" else put it into scriptReplaceString  ---  toComputer  push cd  put 0 into instances  ---  repeat    find whole scriptFindString    if the result is not empty then exit repeat    add 1 to instances    put scriptReplaceString into the foundChunk  end repeat  ---  pop cd  answer scriptFindString && "was replaced" && instances && "times"  beep 2end replaceString</pre>