Page 1 of 1

New Balance from Credit Card Statement

PostPosted: Sat Jun 23, 2018 10:58 am
by SpinalTap
Hello,

I have created a rule that renames my credit card statement, moves it to a folder and also runs an AppleScript that creates a calendar entry in Fantastical based on the Due Date from the statement.

For this calendar entry, I also was wanting to include the amount due. On my credit card statement, it shows the following:

New Balance <spaces> $1234.56

Is there a way to grab the dollar amount ($1234.56, in this example) and store it so it can be passed to my AppeScript? The obvious problem is that this amount, and hence the number of characters, can change every month.

Thanks in advance for your help.

Re: New Balance from Credit Card Statement

PostPosted: Mon Jun 25, 2018 10:45 am
by Mr_Noodle
You can use a custom attribute/match pattern to match that. You can specify a pattern like $(number).(digit)(digit)

Re: New Balance from Credit Card Statement

PostPosted: Mon Jul 02, 2018 12:27 pm
by SpinalTap
Mr_Noodle wrote:You can use a custom attribute/match pattern to match that. You can specify a pattern like $(number).(digit)(digit)


Thanks Mr. Noodle. I just realized that a number like the one in my example would have a comma, so it would be displayed as $1,234.56. Any thoughts on how I can do that? I think I would have to build 2 scenarios somehow - one when the number is $999.00 or less and one that is $1,000.00 or more.

Thanks.

Re: New Balance from Credit Card Statement

PostPosted: Tue Jul 03, 2018 10:39 am
by Mr_Noodle
Yes, you would have to have two conditions to match those different scenarios. Alternatively, you can use "anything" to match everything between the $ and .