"click at" yields "missing value"

I’m trying to script a web form in Safari. Yes, I know doing so is tricky at best, but it’s the only solution.
I maximize the Safari window in JavaScript to ensure the button that needs clicking will always be in the same place. But I can’t get “click at” to work. This version does nothing at all:

tell application "Safari"
	tell application "System Events"
		click at {265, 430}
	end tell
end tell

This version yields a “missing value” error:

tell application "Safari"
	tell application "System Events"
		tell process "Safari"
			click at {265, 430}
		end tell
	end tell
end tell

After viewing many examples of “click at”, I don’t think I’m missing any parameters so I’d like to know what value could be missing. I’ve also found several scripters who have hit this “missing value” error but there are no replies to their queries. Can anyone here help? Thanks!

You have your tell blocks messed. One other thing to be careful of is that the coordinates are measured from the top left of the screen. So make sure your “430” is measured from the top. Try this…

tell application "Safari" to activate
delay 0.5
tell application "System Events"
	tell process "Safari"
		click at {265, 430}
	end tell
end tell

I measured the location using those little coordinates next to the crosshairs in the screen capture tool (cmd-shift-4). Pretty handy.

Thanks for the advice; I removed the System Events tell block from being within a Safari tell block. But the error still occurs.

The full script as it stands now (with sensitive data replaced):

tell application "Safari"
	launch
end tell
delay 1
tell application "Safari"
	activate
	make new document at end of documents
	set URL of document 1 to "http://the.scripted.url"
	do JavaScript "self.moveTo(0,0);self.resizeTo(1180,screen.availHeight);" in document 1
end tell
delay 2
tell application "System Events"
	keystroke "username" & tab & "password" & return
	delay 5
	tell process "Safari"
		click at {265, 430}
	end tell
end tell

The result:

Well I can’t vouch for clicking on a button in a web form. I know normal window buttons work because I’m clicking a button in the Safari toolbar using system events, and it works. I recently released a command line tool which moves the mouse and performs mouse clicks. That might be more robust that using system events. If you want to give it a try go here.