Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Setting a Field value from Applescript

Featured Replies

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

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

  • Author

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

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.