• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Applescript & Mac OS X 10.1 > Setting the Default Printer with Print...

Setting the Default Printer with Print Center

Mac OS X 10.1's Print Center provides access to all printers and jobs, including the default printer, known as current printer in Print Center's dictionary. Script 10 lets the suser choose a new default printer from a list of installed printers.

Script 10. This script lets the user choose a new default printer from a list of installed printers.

					tell application "Print Center"
					set myprinternames to name of every printer
					set mydefaultprinter to current printer
					set mydefaultprintername to name of mydefaultprinter
					end tell
				set myprinter to (choose from list myprinternames with prompt "Set new default printer" default items {mydefaultprintername}) as string
					try
					tell application "Print Center"
					repeat with i from 1 to count of items in myprinternames
					if name of printer i = myprinter then
					set current printer to printer i
					exit repeat
					end if
					end repeat
					quit
					end tell
					end try
				

					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint