Printing documents from XOJO

Greetings ,

Is there a way to print some documents from Xojo without opening the document?

how I do now, for example I have :

Folder Called Project X , inside I have like 4, 5 documents, .pdf, .docx. .xls and so on.
Now what I do I open each document for the user and they have to manually select each , print and then close. Can I avoid this by sending the document directly to the printer and reducing those steps ?

If yes then how can I do this ? some sample code would be great. For the moment for MAC Only.

Thanks a lot.

That assumes the printer is set to a paper type that is right for all the documents.

You can do that by launching an applescript

tell application "Your accurately spelled Printer Name Here" activate print theFile without print dialog quit end tell

you may need to switch the print line to read this:

print theFile without «class pdlg»

or using MBS plugins:

[quote]Function: Print a file to a printer or class on the default server.
Example:
// Print file on default printer…
dim f as FolderItem = SpecialFolder.Desktop.Child(“test.ps”)

for each c as CUPSDestinationMBS in CUPSMBS.GetDestinations
if c.isDefault then

call CUPSMBS.PrintFile(c.Name, f, f.Name)

end if
next
Notes:
name: Destination name
filename: File to print
title: Title of job[/quote]

[quote=384248:@Jeff Tullin]That assumes the printer is set to a paper type that is right for all the documents.

You can do that by launching an applescript

tell application "Your accurately spelled Printer Name Here" activate print theFile without print dialog quit end tell

you may need to switch the print line to read this:

print theFile without «class pdlg»

or using MBS plugins:[/quote]
Thanks Jeff, I’ll have a look and let you know how it goes.