Re: Printer Setup Utility scripting??
Re: Printer Setup Utility scripting??
- Subject: Re: Printer Setup Utility scripting??
- From: "Adam Bell" <email@hidden>
- Date: Sun, 19 Mar 2006 10:17:01 -0400
You do have to know the name of the printer to use lpadmin. One way to get it is with:
do shell script "lpstat -p"
On 3/18/06, Reese, Stevan
<email@hidden> wrote:
This is one of the areas where Apple script can be the hard way.
Cups is well documented except where to fine the info. You can set the default printer with just on line.
Here's how http://localhost:631/sam.html#4_3_3
"Setting the Default Printer
Run the lpadmin command with the -d option to set a default printer:
/usr/sbin/lpadmin -d printer ENTER"
Wrap the command in a do shell script and you're done.
stevan
I use this little script to switch between two printers connected to my machine - It can probably be modified to suit you:
tell application "Printer Setup Utility"
activate
set myPrinters to every printer
set DefaultPrinter to current printer
if item 1 of myPrinters is DefaultPrinter then
set current printer to item 2 of myPrinters
else
set current printer to item 1 of myPrinters
end if
display dialog (name of current printer) as text default button 1 buttons {"OK"} giving up after 3
quit
end tell
On 3/18/06, Russell McGaha <email@hidden> wrote:
Folks;
Anyone have any experience scripting Printer Setup Utility? I've
got to make sure a certain printer is selected before running a
FileMaker script. The difficulty comes because I've got to switch
between printers [Fax and laserwitter] in two reports that need to
run unattended; ANY help would be appreciated [even if I need to do
shell scripting]!!
Russell
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Stevan
--
Some minds remain open long enough for a truth to both enter and leave without processing.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden