Target Printer

I am trying to write a script that will print to a specific printer but I can not get this to work.
What am I doing wrong

tell application "TextEdit"
	set myDoc to document 1
	print myDoc with properties {target printer, "Sharp_AT"} without print dialog
end tell

Thanks
darock

Remove the comma in the properties and replace it with a colon.

I use this (and you can too) to make sure you’ve got the name correct

tell application "Printer Setup Utility"
	set pn to name of every printer
	set myLP to (choose from list pn with prompt "Choose a Printer, Please") as string
	set current printer to printer myLP
end tell

Thanks Adam for the reply. I hadn’t noticed the comma.

But it still does not work it brings up a dialog with my default printer and not the one I am targeting.

I am trying to get around using “Printer Setup Utility”.

Thanks
darock

I have never succeeded in setting a printer from an app. and a quick search doesn’t reveal any other thread where they did.

Hi darock

I totally agree with Adam i haven’t seen or heard of anyone having to much success with what you want.

one way i get round this problem is set the default printer to the printer i want at the beginning of the script and then when its printed change it back.
if you do this via a shell script you don’t after open “Printer setup utility” which can be a pain! using a shell script makes it all go off in the background.

checkout this recent post!!
http://bbs.applescript.net/viewtopic.php?id=21811

hope this helps!