find replace url

I moved a bunch of files from Evernote into DTPO. I would like to strip the useless URL that came across in the move (all URLs contain evernote*). I can create a SmartGroup to find the dcuments. Is there a search/replace function where I can find a wildcard string, evernote*, and replace it with nothing?

This script will remove the “evernote://…” URL for all selected records that contain an URL with that string

tell application id "DNtp"
		set theSelection to the selection
		repeat with thisItem in theSelection
			if the URL of thisItem contains "evernote://" then
				set the URL of thisItem to ""
			end if
		end repeat
	end try
end tell

Copy the script. Open Script Editor. Paste the script. Compile and save the script in a personal subfolder of ~/Library/Application Support/DEVONthink Pro 2/Scripts. Select the items found in your Smart Group. Run the script from that folder in the DEVONthink Scripts menu. (As soon as the script deletes the URL, the item will disappear from your Smart Group.)

Awesome! Thank you. It worked like a charm.

I LOVE IT - thanks for that script!

If you export your notes from Evernote to an .enex file and then drag that file into DEVONthink, you won’t get the evernote:// URL in your notes, you’ll get the URL that Evernote recorded when you clipped that note to Evernote. If you use DEVONthink’s File > Import > Notes from Evernote… you’ll get the evernote:/// URL.

Personally, I prefer the former approach over DEVONthink’s Import.