• 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: Printer Setup Utility scripting??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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




On 3/18/06 4:41 PM, "Adam Bell" <email@hidden> wrote:

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

References: 
 >Re: Printer Setup Utility scripting?? (From: "Adam Bell" <email@hidden>)
 >Re: Printer Setup Utility scripting?? (From: "Reese, Stevan" <email@hidden>)

  • Prev by Date: Re: Say command using "Organ" doesn't work
  • Next by Date: Synchronization Issues? or Why do my Shell Scripts Bite me after they are Done?
  • Previous by thread: Re: Printer Setup Utility scripting??
  • Next by thread: Couple of Applescript questions....
  • Index(es):
    • Date
    • Thread