This code is generating an error. Can someone help me fix it? Thanks!
to findAndReplaceInText(theText, theSearchString, theReplacementString) set AppleScript's text item delimiters to theSearchString set theTextItems to every text item of theText set AppleScript's text item delimiters to theReplacementString set theText to theTextItems as string set AppleScript's text item delimiters to "" return theText end findAndReplaceInText tell application "Finder" set fold to folder "current_projects:macjournal_export:subset" of home set filenames to the name of every document file of fold set filedates to the creation date of every document file of fold -- set filenames to the name of every document file of files repeat with filename in filenames set fn to filename as string fn = findAndReplaceInText(fn, ".rtfd", "") findAndReplaceInText(fn, ".rtf", "") --set s to end repeat end tell
When I run it, I get this mysterious error
on this line:
findAndReplaceInText("\"The art of being wise is the art of knowing what to overlook.\".rtf", ".rtfd", "")
Not sure how to post an actual screen shot here but I can if it will help.