Document Amount placeholder vs. "document amount" property of a record

I’m confused about the relationship (if any) between the Document Amount placeholder and the document amount property of a record.

Detected Values: The following placeholders get their values from the name or content of a matched document. For example, the Document String is the result of a Scan Name or Scan Text smart action.

Document Amount: This is an monetary amount detected in the name or content of documents, typically receipts or invoices. (%documentAmount%)

This seems to say that you have to do a Scan Text (or Name) to get a value for a Document Amount.

However, document amount is listed as a property of a record”

document amount (text, r/o) : Amount extracted from text of document, e.g. a scanned receipt.

If I select an emailed (.eml file) bill in my database Inbox – never having done a Scan Text for an amount – and run the following in Script Editor:

tell application id "DNtp"
	set theRecords to the selected records
	repeat with theRecord in theRecords
		try
			set theAmount to document amount of theRecord
		end try
	end repeat
end tell

the output is, as expected for this particular email, “$700.07”. So it appears that getting document amount somehow performs an implicit “Scan Text” for “Document Amount”. (If so, how does it know which amount to get when there are more than one?) Would this populate the placeholder? Does a Scan Text populate the record property? Or is there no connection between the record property and the placeholder? Is the Scan Text action for Amount superfluous unless there are multiple amounts and you need to pin it down with a RegEx?

(DEVONthink 3.9.13, macOS Sonoma)

While I can’t answer the deeper technical part of your question, I’m confused as to the impetus for your question. If you’re inclined to use the Scan Text smart action, you can. If you want to use a script or a script smart action, you can do that too. Are you running into an actual issue or discrepancy or just curious about the mechanism?

PS: The current version of DEVONthink 3.x is 3.9.16. You should update and stay current with our point releases.

Mostly curious about the mechanism. I like to understand what’s happening “under the hood”, so to speak, so as to avoid unexpected outcomes. When the same or very similar terms are used in connection with two different processes/concepts, they may appear to be the same or closely related even if they are not… which can result in confusion about how to do something, and time wasted on resolving inexplicable results.

Conversely, understanding how related mechanisms may interact with each other can give insight into which is the best path, or a combination thereof, to accomplish your purpose.

Thanks for the heads-up on the point release. I tend to keep DT running for days at a time, so I don’t always see the update notifications. (Of course, what I really need to do is install DT4 which I bought some time ago. :face_with_diagonal_mouth:)

Gotcha - and @cgrunenberg is the authority on the wiring and plumbing of it all.

And i heartily encourage you to move to version 4. So many new and improved things. Just make sure you delete the version 3 application and reboot the Mac. Don’t run an uninstaller; just delete the app. If you want a deeper cleaning after the transition, open a support ticket and I’ll assist.

The Scan Name/Text action is optional, e.g. in case that the automatic detection of the right amount fails or if the amount is in the name. Otherwise the property and the placeholder are identical and both use only the text of the document.

1 Like

Thanks for the clarification.