Login to webmail

.

I can’t remember now the reply-sentence for this question… It was something as “you’re only stupid if you didn’t learn something new” (or similar) :smiley:

Repetitive tasks and application intercommunication via apple-events. This is the main goal of AS. I have no experience with these two apps, though. I would try a new post in the forum (and, if no luck, in AUL → Apple’s AppleScript Users List)

Okay guys I’m new and I’m sorry for rehashing an old thread!!

I’ve done heaps of searching and reading and am fast coming to the conclusion that perhaps my bank specifically doesn’t want me to use Applescript to log in and suck out my transactions!!! :mad:

I’ve tried both the methods listed here and neither seem to work.

First of all the URL to the bank is:

https://www.anz.com/inetbank/bankmain.asp (In case you didn’t know it’s in Australia!)

Here is the script so far…

property target_URL : "https://www.anz.com/inetbank/bankmain.asp"

tell application "Safari"
	open location target_URL
	activate
	delay 1
	tell application "System Events"
		keystroke "MyLoginID"
		keystroke tab
		keystroke "MySuperSecretPassword"
	end tell
	do JavaScript "SubmitEBS('Modify')" in document 1
end tell

Here’s the peculiar thing. If I take out the do JavaScript “SubmitEBS(‘Modify’)” in document 1 line and click on the button myself it works. If I let the Applescript do it it says that I have the wrong userid or password. I think it’s doing something clever in the background but can’t work out what.

I know this should be easy but I’m really struggling here guys and would appreciate some help from anyone, anywhere.

Thanks in advance,

Jordan

I think the javascript code should be something as:

set x to "
document.forms[1].elements[10].value='customer reg num';
document.forms[1].elements[11].value='password';
if (ValidateForm('Modify')) SubmitEBS('Modify');
"

tell application "Safari" to do JavaScript x in document 1

Thanks jj!!! You’re brilliant.

I was really thinking I was stupid. Turns out it is a little more complicated a site than some of the others that have been listed as examples above. I’m hoping that it’s just the login that is complicated and after that it becomes straightforward. Going to be much harder to get help from here on as you need to be in the site!

Again. Thanks for the help. I will try and work out where I went wrong and learn from this.

Cheers,

Jordan

Well, if you see the “thing which happens when you click the log-on button”, we find a “regular link”: “javascript:SubmitEBS(‘Modify’)”. But we find also an “onClick” handler: onClick=“return ValidateForm(‘Modify’);”

This one will be executed in the first place. And, depending on the result of its execution (true/false) the thing in the “href” (SubmitEBS) will be executed or not. So, we will first call ValidateForm. If result of its execution is “true”, we will call later SubmitEBS.

Every form is a different world, but most of them can be trobleshooted very easilly (I think) → banks, though, are different stuff: they usually have tricky methods (basically, to slow casual attacks), extensive validation of data, etc. But they all can be filled and submitted.