Pages

2 juin 2008

Multiple find replace

on nFindReplace(theText, string1, string2) -- multiple search replace
repeat with i from 1 to the length of my string1
set AppleScript's text item delimiters to character i of string1
set theList to text items of theText
set AppleScript's text item delimiters to character i of string2
set theText to theList as text
end repeat
set AppleScript's text item delimiters to ""
return theText
end nFindReplace

>>Ouvrir le script dans l'éditeur

Aucun commentaire: