Print Folder Contents - Page Setup in TextEdit

Hi All,

I am am in a somewhat desperated need of a hand, I have no AppleScript experience whatsoever, so I apologise for what may be an obvious question.

My problem is this: I have recently been forced to install Outlook 2003 running under Crossover Mac for my users, the problem is that anytime you try to print Outlook crashes. To get around this I have set up a ‘Print Folder’ that prints then deletes anything that is saved or moved into it. The idea is that the users can ‘Save As’ into the folder and the printer will then spit it out. Now, this works great when the e-mail is text only as the system defaults to a paper size of A4. However, more complicated e-mails with rich text reatures are saved as HTML and, HTML documents seem to ignore this default A4 paper size and set themselves to US Letter - which means our printers print them onto A3 size paper.

I am using the following script to set up the ‘Print Folder’.

on adding folder items to this_folder after receiving added_items
	repeat with this_item in added_items
		tell application "Finder"
			print this_item
			delete this_item
		end tell
	end repeat
end adding folder items to

My question is: how do I change the script to tell TextEdit (which I have set as the default application for HTML docs) to change the paper size to A4, then print (default printer is fine), without requing user input. We are running Mac OS 10.4

I have searched the forums and Apple’s AppleScript pages, but despite many similar questions, my attempts at applying these solutions to my case have been unsuccessful. My knowledge and experiance of ApplScript is currently too limited for me to figure it out.

Any help on this matter would be greatly, greatly appreciated.

Spikey

Sadly Spikey I don’t think you can do this :frowning:

I looked in the dictionary for Text Edit and while its print command does accept some properties paper does not appear to be one of them.

Here is what it supports:

collating get/set boolean Should printed copies be collated?
copies get/set integer the number of copies of a document to be printed
ending page get/set integer the last page of the document to be printed
error handling get/set error handling how errors are handled
fax number get/set string for fax number
pages across get/set integer number of logical pages laid across a physical page
pages down get/set integer number of logical pages laid out down a physical page
starting page get/set integer the first page of the document to be printed
target printer get/set string for target printer

Hurrm,

would it be possible to do this though Safari or MS Word, or any other app for that matter?

Spikey

Hi Spikey

Not sure about MS Word, safari will open your html but i would imagine you will still not be able to change the paper size, all that info is picked up
from the PPD for that printer, you might be best looking at trying to open it in Acrobat or something similar, then you will open up a whole load of print preferences i guess.