Is it possible to print without prompting the dialogbox?

Is it possible to generate a random file name without prompting a dialogbox to ask?