Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7438 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi There,

I'm new to using Applescript with Filemaker and need some help. I have an applescript that shows a list of printers connected to a computer and allows you to select a default printer which it sets through Print Center. Here is the script.

tell application "Print Center"

set printerlist to name of printers

set oldprinter to name of current printer

set printerchoice to (choose from list printerlist with prompt

Posted

I think you have one extra variable you don't need, as you've already set printerChoice via the dialog. Since the result is the name of a printer as a string, you have to address it as such to set the current printer.

Printer list could be either a repeating or plain global field (mine's plain; I only have 1 printer; so I'm not even sure if this works :-|

Printer Setup Utility is very particular about where the "quit" step is. That's why the 2nd tell block to it. I kept getting errors otherwise.

tell application "Printer Setup Utility"

set printerList to name of printers

set oldPrinter to name of current printer

set printerChoice to (choose from list printerList with prompt

Posted

Worked like a charm!

Now I can use the captured list of printers as a value list. I have mutiple printers and would like to print different things from my solution to different printers. CD Labels in one printer, Invoices on a LaserPrinter, Photos on a Stylus Pro 5000, Mailing Labels on a little Tymo label printer etc. So I'll use additional scripts in filemaker to send values to print center using applescript so before a given print job the default printer in print center will be changed to one I selected from the list of printers I have. I've used the restore option in the print and page setup script steps but have noticed they sometimes get reset. I wish there was a way to tell Printer Center to Hide or change the default printer without even launching Print Center. Oh Well :-)

Thanks for your help! It was perfect.

Mark

This topic is 7438 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.