DEVONthink Pro "if exists record" behavior

Hello all.

I’m trying to polish a system I have developed to move pdfs into and out“of DEVONthink Pro. What I want to add is the ability for the script to determine if a record with the file name is already in the database and, if so, replace all instance of it. I am having trouble with the “if exists record with file” command; it never returns true. I’ve tried many tests including:


tell app "DEVONthink Pro"
if exists record with file "homework" then --which I know exists and is top-level
return "Found"
else
return "Not Found"
end if
end tell

Does anyone know why this would always return false? Any advice would be greatly appreciated.

Model: iBook G4
AppleScript: 1.10.7
Browser: Camino 1.6.3
Operating System: Mac OS X (10.4)

Hi caseykoons,

From what you describe (import/export of PDF files) I guess that the real file name is not «homework», but rather «homework.pdf». Maybe you chose to hide its extension. So try this instead:


tell app "DEVONthink Pro"
if exists record with file "homework.pdf" then --which I know exists and is top-level
return "Found"
else
return "Not Found"
end if
end tell

It’s only a wild guess, but I once experienced this problem myself :smiley: