best way to script this! via Quark or another way!!!!

I’m working on a script which prints,pdf’s etc… from quark,
the problem is the quark docs which are coming from the customer are holding there printer information.
i have managed to change all the info to my printer details except one bit,
When i open one doument manually i get a dialog box saying “pages only allowed between 1 and 999”
i know where the problem lies just don’t know how to change it in a script, once the document is open i
goto the print dialog box, then go down to the button “printer” and click it, this takes me to another print setup box
and in there instead of having the “all” button checked the “pages” button is checked with a range from"28007 to 28007" and you can’t have that many pages in quark
hence the reason why the popup dialog at the begining. if this was in the original quark print dialog box i could change it but thats just set to all pages which is right,
The way i’m getting round it at the minute is via a system events line in my script which when the dialog pops up it presses return to remove it.
this seems to work ok for now.
Anyone got any ideas…
Thanks in Advance