Replacing & symbol in Indesign

I have built an Applescript to find and replace English words with their Spanish translations.
There is one grouping that has the “&” symbol in the word and the script only replaces the first, not the symbol or the word preceding it
If I break down and replace just the symbol it works. However I would like to keep it to all the words instead. Here is what I have:

search for “Cash & Other” replacing with “Efectivo y otros” with case sensitive and whole word

Please let me know if you can help me out.

Happy Friday

Paula

There isn’t anything wrong with the line of code that you posted. I read your question’s particular phrasing, and I just want to be sure that you understand that you are searching for an exact string here, not a word.

I’m not sure if it has something to do with EasyCatalog because it just won’t work.
One question, can you find and replace to certain areas in a document? Keeping it to one section? Kind of like find and replace to “story” or “selection”.
How you denote that with applescript? Thanks so much for getting back to me.

Paula

Yes, you can confine searches to items like stories, selections, frames, etc. - directing your search in a tell block is one way (e.g., tell the selection to search for…). There are examples and other relevant info in the Indesign Scripting Guide. Regarding your original question, I’m not familiar with EasyCatalog - do you get the expected result if you perform a manual find and replace within ID? If so, could you post a snippet of your search text and the rest of your script?

I just figured it out. I had another find and replace before it and it replaced half of the word so when the next find and replace was looking for a word that had already been translated therefore it didn’t translate the entire string. HAHA.

Thanks for your help. Sorry for any inconvenience.

Paula

Still going to try and figure out how I can find and replace by searching for a specific sections.