Trying to find and replace text in clipboard
I am trying to copy a file path to the clipboard and replace the word "Volumes" with "MyServer". Currently I can get the path and replace the spaces, which is working well. Now I just need to replace that word "Volumes" and I'm having no luck. Here is the code I currently have. Any help would be great.
tell application "Finder"
set sel to the selection as text
set TempTID to AppleScript'stext item delimiters
set AppleScript'stext item delimiters to space
set sel to text items of sel
set AppleScript'stext item delimiters to "%20"
set sel to sel as string
set AppleScript'stext item delimiters to TempTID
set the clipboard to "afp://" & POSIX path of sel
get the clipboard
end tell
OS X Mavericks (10.9.4)