Basic Printing....

What is the secret to get something to print, in any app? Obviously something like:


tell app "TextEdit"
print 
end tell

isn’t enough. But I can’t seem to get any app to print anything at all. Is there a secret?

If the doc you want to print is already associated with the application you want to print it with, then you can just tell the finder to print and it will sort out the rest.

e.g., if you have a .txt file with a BBEdit icon, and you want to print it with BBEdit then you can just use:

tell application "Finder"
	print file "Noodles:Users:colin:Desktop:test.txt"
end tell

And the finder will launch BBEdit, tell it to print the document, and then quit BBEdit.
Or if you want a particular app to print it then you’ll need to ask that app:

tell application "Tex-Edit Plus"
	print file "Noodles:Users:colin:Desktop:temp.txt"
end tell

-Colin.