• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Printing w/o interaction?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Printing w/o interaction?


  • Subject: Re: Printing w/o interaction?
  • From: Philip Aker <email@hidden>
  • Date: Fri, 14 Feb 2003 05:50:37 -0800

On Thursday, February 13, 2003, at 12:54 PM, Michael Sullivan wrote:

I want the script to simply print, without showing the dialog if possible.

We just went through this in considerable detail within the last week. Search the archives for "Re: Printing to PDF via GUI scripting" posts.

I don't think so. Your solution worked fine for text files but what if you want to print Word (.doc) files?

Apple is taking care of the formats it considers native. I've tried .ps, .pdf, .txt, .html, .rtf, .jpeg, and .tif. All is well.
If you need to print (alien) .doc files via a shell script, why don't you just have Word save the file as an HTML or an RTF? Or maybe run them through a translator (some come with AppleWorks) or perhaps have them converted online somewhere before printing?

Look at this for a sec:

/usr/libexec/cups/filter/nstexttopdf 1 philip "PDF_JOB" 1 "" tmp.rtf > tmp.pdf

The main problem here is that there is absolutely NO FREAKIN' DOCUMENTATION FOR NSTEXTTOPDF!

Not to mention that I don't know how to set up an lpd filter or whatever the backend thing is. However we already know that Cocoa handles .txt and .rtf as well as an assortment of graphics formats transparently. So I've just pumped in some arbitrary values and it works.


It just so happens I'm working on this right now. Ideally I'd like to use Finder scripting (those properties Dennis mentioned) to save a Word (or whatever) file out as Postscript (i.e. set "Output Options"). I haven't been too thrilled with GUI scripting so I am not using that (for now). Since I can't get that going (yet) I have set up a "printer" to save the Postscript files it gets out to disk. Then I can convert that to PDF and have fun with it. Still very early. I'll let you all know if I get it working well.

I'd be interested, but my real needs are somewhat different. Currently, I have an older Apple PostScript serial port printer. Works great when I have it attached an old Mac on our network and use LaserWriter Bridge to handle things. But I don't really want that. What I want is to have the printer work directly through the serial port on the G3 and have the color USB printer attached to our iMac available as well.

I know it's possible. I've come up with a lot of stuff from NetBSD and linuxprinting.org but have yet to wade through it or understand it. Also a very interesting article:

http://www.mcgillis.org/~matthew/printing.html

I picked up the code. It's a driver for a Color StyleWriter 2400. What I figure is needed is a generic PostScript driver. I can't say if I'd be able to adapt his code, but if anyone is familiar with the area, the author has a separate module for the basic serial port interaction and it's only the 2400 part that would have to be warped to be LaserWriter oriented.

Boy, this was a lot easier with old Unix printing. You'd just fake things out with an lpr filter or an lp shell script. Now you need CUPS drivers and what not. Got it fooled but it's ugly...

Fool away but do let us know.


Philip Aker
http://www.aker.ca
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Printing w/o interaction?
      • From: Michael Sullivan <email@hidden>
References: 
 >Re: Printing w/o interaction? (From: Michael Sullivan <email@hidden>)

  • Prev by Date: Re: Getting FMP to print to .ps via AppleScript
  • Next by Date: NuBe Apology
  • Previous by thread: Re: Printing w/o interaction?
  • Next by thread: Re: Printing w/o interaction?
  • Index(es):
    • Date
    • Thread