Thanks a bunch @Tom for the comprehensive explanation of how I might be able to search and replace directly in the RTF document. I was able to follow your instructions and do a manual simulation of how I might be able to build a KM macro to achieve my objective. It all looks possible when the Evernote note only contains hyperlinks.
However, I hit two issues when the Evernote note contains an image or attachment:
-
If an image is present, TextEdit requires the file to be saved as a RTFD format which does not display the source information when the opened with the option to "Ignore rich text comments". I suspect this issue might be overcome by using a different text editor.
-
Attachments in an Evernote note do not get copied to the KM clipboard so they will get lost in any macro I create that relies on clipboard manipulation. That's a showstopper for me as I need my search and replace macro to work across all notes I have in Evernote, not just the ones that only have hyperlinks. I suspect the only way around this is to get directly into the note source as @JMichaelTX indicated he did in his reply after yours. His approach of accessing Evernote's source .ENML files looks promising.
@JMichaelTX, wrt my objective, I am trying to create a search and replace macro to make up for absence of this feature in the current Evernote for Mac app. I would like to go one step further and also be able to search for specific hyperlinks and replace with another chosen hyperlink. Your post prompted me to dig a little deeper into ENML and I see that a lot of users have chosen to edit the source ENML file as a way to make up for the deficiencies in the Evernote editor. I suspect your AppleScript might be very useful for me to do this so would be very grateful if you could post it. I am sure it will help me one way or another on my automation journey.
Thanks again.