save as pdf

I used this script recently for safari and it used to work but with upgrades in Safari it no longer works.
I have switched to camino since I can use “tab”, “space” and other commands to move around the web page.
I would like to print a pdf of a webpage and save this to a file, however I’m getting an error that says

How can I fix this script?

set myDelay to 1
tell application "Camino" to activate
tell application "System Events" to tell process "camino"
	keystroke "p" using command down
	delay myDelay
	click menu button "PDF" of sheet 1 of window 1
	delay myDelay
	click menu item "Save as PDF." of menu 1 of menu button "PDF" of sheet 1 of window 1
	delay myDelay
	keystroke confirmationo & ct
	click button "Save" of window "Save"
end tell

Instead of using GUI scripts which will keep breaking from time to time and change from one application to another:

you might want to use this:

http://www.codepoetry.net/projects/cups-pdf-for-mosx

It will work in all apps. You just have to press Cmd+P and hit enter.
Follow the instructions properly to set it up correctly.

That’s great but I would have to install it on any computer that uses the script.
Any Idea’s on why the scripts are no longer working?

change

tell application "System Events" to tell process "camino"

to

tell application "System Events" to tell process "Camino"

It uses UI scripting. UI elements change from one version to another and one application to another.

this script works on
Camino Version 2.0b4 (1.9.0.15pre 2009091516)

set myDelay to 1
tell application "Camino" to activate
tell application "System Events" to tell process "Camino"
	keystroke "p" using command down
	delay myDelay
	click menu button "PDF" of window 1
	delay myDelay
	click menu item "Save as PDF." of menu 1 of menu button "PDF" of window 1
	delay myDelay
	click button "Save" of window "Save"
end tell

Is there a way to do this and save it as a straight html or even .txt file instead of a .pdf?

Thanks.