I’m trying to use “document amount” to pull the bill amount from email.
set theAmount to document amount of theRecord
Sometimes the string returned has a dollar sign and/or a comma, sometimes it doesn’t. For example, one email returned $1,187.00 (exactly as it was rendered in the email), while another returned 1352.00 although the email text was $1,352.00. These billing/payment emails uniformly include a dollar sign on the amount, with no intervening space.
The presence or absence of the comma makes no difference to me, but the inconsistency of the $ is making it difficult to use the result in constructing a new filename (do I concatenate with a “$” or not?) or coercing it to a number for later use (“set… as real” throws an error if the $ is there, but stripping the first character of the string removes a digit if the $ isn’t there).
How is “document amount” intended to work?