Applescript Import a file but overwriting an existing file

I set up a very basic AppleScript to import a file to DevonThink, that is ran by Hazel, when a file is placed in a folder.

tell application id "DNtp"
set thisGroup to incoming group
import theFile to thisGroup
end tell

Right now it is just going into the global inbox but when I tried to import into my desired database, it would create a new record. Is there a way to tell DevonThink to overwrite a record based on the incoming filename? If all else fails I guess I could use the incoming file name to find if a record exists, delete it, and import the new record but it would nice if the tags and meta data could be preserved and just the contents of the record be updated. I plan on only using this for text or rich text files.

Thanks in advanced!

Welcome @latca

  1. No that’s not how DEVONthink works. You can have files with the same name in the same locations in s database.
  2. Why are you importing the same file multiple times?

Thanks for the reply. I was hoping to have a notes file that gets updated over time with new text. That way when I pull up the note in Devonthink it will be the latest version I imported.

Specifically I take notes using OmniOutliner in the same file over time. I was hoping to export that text from OmniOutliner whenever I have new notes into a DevonThink entry.