"Save As PDF..." scriptable to run in background ?

Hello All,

does anybody know, if there is a manner
to access with applescript (or however)
the function “Save as PDF…” in the Safari
Print “Dialog" so that the web – page can
be saved as PDF in a predefined folder and
that this works as “background activity ? !!!
The applescript sample below works to dump
the actual www as pdf to a folder, the problem
is only that it acts in foreground as I would do
it by hand clicking file , print …, is it possible
to run it as background (unvisible) function and
/ or any idea to let “Save as PDF…” run in
background ???

I would appreciate any help / solution.
Thanks a lot.

linus

P.D. : btw thanks to all that helped me so far :lol:

“quote”

tell application “Safari”
activate
ignoring case
set theURL to URL of front document
set theSource to source of front document
set AppleScript’s text item delimiters to “title>”
set theSource to second text item of theSource
set AppleScript’s text item delimiters to “</”
set theTitle to first text item of theSource
end ignoring
end tell

tell application “System Events”
tell process “Safari”
click menu item “Print…” of menu “File” of menu bar item “File” of menu bar 1
click menu button 1 of UI element 3 of sheet “Print” of window theTitle
click menu item "PDF TO TEST " of menu “BevelMenu” of menu button 1 of UI element 3 of sheet “Print” of window theTitle
end tell
end tell

“unquote”