display dialog ( my searchAndReplace("my mommy", "my", "your") )
on searchAndReplace( txt, srch, rpl )
set oldtid to AppleScript's text item delimitersend searchAndReplace
set AppleScript's text item delimiters to {srch}
set temp to every text item of txt
set AppleScript's text item delimiters to {rpl}
set temp to (temp as string)
set AppleScript's text item delimiters to oldtid
return temp
레퍼런스 :
Read and write text files with AppleScript
No comments:
Post a Comment