Statement Download part 2

I’m not sure if this will meet your needs/requirements, but you might want to checkout this service which is designed to download statements from a wide variety of sources:


I am aware of the site and I am a member. My goal is not to have my financial documents on anyone’s cloud. As it is, I already use ShoeBoxed but just for receipts because there aren’t Address and Account numbers listed on receipts. Bank and Credit Card Statements however are a different thing altogether. They have your name, your address, and often enough of an account number that the rest can be culled from other sources. If I were ok with having all that data out there I would probably just go for Mint which also does the same thing.

In addition they also scrape your account information to sell a profile to banks and financial services about you. :smiley:


This would be great. I am just not sure how to complete the fields for the Set Variable To Keychain Password panel.

I had no idea they did this. I am investigating, and if I can confirm then I will cancel my account. Do you have a source for this information?


I was referring to Mint which is rumored to be doing this and it makes sense because of the type of offers I am now getting spammed with because of signing up only one account on Mint.

If you would like to discuss this further, please message me. I would rather not muddy up this thread with discussions that are off the topic of the Statement Download script I am working on. I am happy to discuss it further if you like. It just doesn’t seem relevant in a thread others may reference to help solve their issue. Does that make sense?

Hey John,

Open the Keychain

Get-Info on the password you want to use.

Use the Name and Account specified in the Get-Info panel.

When you first run your macro you’ll be asked to permit Keyboard Maestro to use the KeyChain for that item.


1 Like

Hey John,

In post #4 I’m using Keyboard Maestro’s built-in form-field-discovery menu.

Otherwise I use the developer tools in Safari, Chrome, or Firefox.

Once those are active you can use the Contextual-Menu to Inspect Element and save yourself the trouble of parsing the entire source.


Sorry, I violated one of my own rules to stay on-topic. It makes sense and I agree. Will PM you with response I got from FileThis.

I actually got that far. (How was that possible for me?) :smile:
Where I am confused is what to do with the stuff that’s pre-populated. In this case:
"Set variable to: Variable"
"To Keychain Password named Password Name [in this case the link ] “” [then] “(JohneDoe)”, [my userID in parenthesis]
with the remaining line “account:” populated with %UserLoginID%

So do I need to do enter anything in the Variable field or is that just a user defined description or does it require some absolute value? I assume what I put on the second line was correct [ (JohnDoe) ], am I right?

Then… I will hazard to guess that %UserLoginID% requires no modifications on my part and it will snag the UserLoginID and populate the field. Or would I need to change it to %JohnDoe%

Or have I got all of this munged into abstract wall art? :sunglasses:

Ah, I see… So nothing exotic then. I am guessing your built-in form-field-discovery menu looks different because you’re using version 7.x of Keyboard Maestro. I haven’t installed 7.x yet because I haven’t upgraded OS X.

01/21/2016 4:07 PM UPDATE: I installed Yosemite today and see that my newer version of Keyboard Maestro which I just installed does looks like yours now.

No apology necessary JMichael… I really do appreciate your contributing the service link. Someone will get something out of it for sure!

Ok so here’s the latest. The bank whose statement I was trying to download finally fixed the page so that after I click login, it calls the keychain and autofills the password. So I no longer need to fill the password in. does it for me.

Chris’ script worked great but I elected to re-type just so I could sort out what was happening and learn from it.

Chris mentioned being able to use and that seemed like a better idea rather then putting the password in the macro so I tried to implement that part.

I couldn’t get it to work though when I was doing the typing so in the process of reading the documentation and then finally finding Peter’s examples on using Keychain manager, I completely re-wrote everything.

So now when the macro runs when the user ID is entered the password auto fills.

Next, I was able to use the “Click Safari Link” to get to the ‘eStatements’ page. Then I was able to use it again to click on the ‘Oniine Statement Ready To View’ link on the subsequent page. (If I miss a month there is more than one link called ‘Oniine Statement Ready To View’ which will not be a problem once I get the script working but for testing it’s a pain because once I test, the link goes away).

The last page I arrive on is the actual statement but it doesn’t display as a PDF nor does it provide a “download statement” link. Instead, They provide a “Printable Version” link, along with 3 other links to print each section (IRA, Savings and Checking).

They all appear to be running javascript to initiate the print dialogue. When I “inspect Element” by right clicking the print link I want, it gives me the following:

<a href="javascript:printVersion()"><img src="/images/icons/printer.gif" border="0">Printable Version</a>

I also note that it’s part of a table:


So how do I got about referencing this for the click?

Hey John,

No idea.

I think you can call JavaScript functions on a page, but I don’t know how.

@ComplexPoint would have a better idea of what’s possible there.


My first experiment would be to run an action like this from Keyboard Maestro:

Thanks @ccstone. @ComplexPoint: I tried it. It didn’t work. There are lots of frames/tables. Is it possible this could be complicating things?

Ok I am now working on a different area of the script. I was trying to select the text “Online Statement Ready to View” but I couldn’t get Javascript to find it and click it. So after doing a lot of inspection I found a .jpg on the page and after much trial and error I was able to get it to click on “Statements” which takes me to the current months statement along with a list of the others in the right frame. So this is a different path to the same result.

Using the click image step I noted that the mouse was resting after the step ran and I could see where it landed. I kept adjusting the numbers as it was landing lower then the link location. I finally got within 5 numbers. (I assume these are pixels), and I nailed it.

Two things I learned from this:
1.) It wasn’t finding the image. So by adjusting the focus on the image the KM alert that it couldn’t find the image went away. This gave me a hint that maybe now it was finding the image. So I was able to move on to getting it to click at (250,330).
2.) Peter often suggests breaking macros into smaller steps. (Don’t quote me on that actual wording) So that’s what I did here. I used F2 to run the first macro that logs me into the account then navigates to the statements page. Then it fails when trying to click the view statements. So I continued on in a new macro and assigned it to F3 which allowed me to work forward from where it failed. Once I got all that working I now only have the final issue of getting it to click the print button, then save as pdf, then title the pdf.

So at this point I am wondering if I should just use a "click at (0,0) action to try and nail the link with a click using the image as before (the "click image at (250,330) step above), only now using the adjusted coordinates for “PrintVersion” link to print the statement? (Then I will use keystrokes to fire my Print PDF keystroke I programmed into MacOSX, which is “^P” when the print dialogue is open).

[quote=“Tunes, post:21, topic:2513”]
I was trying to select the text “Online Statement Ready to View” but I couldn’t get Javascript to find it and click it.[/quote]

Hey John,

You did use Keyboard Maestro link pop-up menu on that page to try to find the correct link – yes?


@ccstone, Hmm… Gee. I don’t know. What ’ link pop-up menu’ are you referring to? Is this something in the Service Menu that I missed or maybe didn’t install?

Hey John,

See the little v after Safari (by the cursor)? That indicates a pop-up menu.

Using that you can discover right quick if Keyboard Maestro can see a link on a page.

The displayed links are from:


I think the reason I missed that little popup menu is because I was looking at the Execute JavaScript panel.
However when I went to the Click Safari Link panel and clicked on the Safari Popup menu ("v"), it says:

"No links found"

So I see what the problem is now, and none of the previous attempts at JavaScript calls worked.

As I mentioned before the page where I am trying to set the link is several frames so I wonder if that's causing a problem. I was also curious if it's possible they might have some security in place which blocks my using JavaScript? (Although it's more likely I just don't have the right element defined yet).

It looks like they are calling a app number then in the same argument specifying a document title ID.
This is what Inspect Element in Safari snags for me:

<a href="javascript:openLink('/cowww5/viewers/viewdoc_titlejs.asp?DoctitleID=1301227&AppID=128')">Statements</a>

I tried using "Statements" by itself which didn't work. I also tried Execute JavaScript javascript:openLink('/cowww5/viewers/viewdoc_titlejs.asp?DoctitleID=1301227&AppID=128') but I can't recall exactly what I tried. Taking the code you came up with the login page I used similar language and plugged in the line above.

I tried:


(I used document.forms but I am not sure how)
and also:


(I used document.getElementById('btn-login').click() and inserted the stuff between the parenthesis but realized that was probably looking for a button which doesn't exist in the link referenced above)

And finally I noted the following:

So I tried this:

Which didn't work. So maybe I lack the needed JavaScript vocabulary to do this.

Hey John,

There’s one in the forms actions too. (Always look for and try the pop-up menus in the actions.)

That can happen.

I would look at the target page URL and compare it to this:

open Link('cowww5/viewers/viewdoc_titlejs.asp?DoctitIe|D=1301227&App|D=128')

You may be able to decode how they’re calling the page.

You may or may not be able to extract that call from the document source.