Skip 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.

Selecting a Printer Tray on a Mac

Featured Replies

Here's my answer to selecting a printer tray on a Mac. It uses AppleScript. Maybe there's a more elegant solution, but I coudn't find one in a hurry.

For the past several days, I've been trying to get a Mac running 5.5 to select a particular printer tray for printing labels. I looked into modifying a PPD to make it only use a particular tray, but I was still stuck as far as making it work relatively seamlessly for the user. (OK, truth be told, I couldn't make heads or tails of what was going on in the PPD, mine didn't look anything like the one in the examples I've seen.)

Anyway, then I noticed that there's a LaserWriter 8 Prefs file in Preferences:Printing Prefs. And I said "A-HA!"

For the record, we're on an iMac running 9.2 printing to a Laserjet 2100 (ML I think) which is available when you choose LaserWriter 8 in the Chooser. I've only tried it on the one kind of printer, so I don't know if this will work in all, most or even some cases. But it worked for me. Here's what I did:

Go into System Folder:Preferences:Printing Prefs. Duplicate the file LaserWriter 8 Prefs.

Rename the original LaserWriter 8 Prefs file to LaserWriter 8 PrefsOrig.

Rename LaserWriter 8 Prefs Copy to LaserWriter 8 Prefs.

Print something to bring up the print dialog. In the tray selection menu, change it from your usual setting (ours was set to "autoselect") to the setting you want to use (in our case, Tray 2 of a three tray printer).

Click Save Settings and click OK when asked to confirm. Now, click cancel to close the print dialog.

Go back to the Finder and change the file names again:

Rename LaserWriter 8 Prefs LaserWriter 8 PrefsT2. (this is so I'll remember it's set to "tray 2")

Rename LaserWriter 8 PrefsOrig to LaserWriter 8 Prefs.

If you like, print something again and you'll see the settings are back to what they were before you started.

Now, go into FileMaker, bring up the script that contains the print job. Let's say it looks like this:

Print Setup [Restore, No Dialog]

Print [No Dialog]

You'll want to add two Perform AppleScript steps both before and after the Print step. These will flip back and forth between the two settings (Tray2 and whatever you're default is):

Print Setup [Restore, No Dialog]

Perform AppleScript

Print [No Dialog]

Perform AppleScript

The first Perform AppleScript step will rename the two preference files.

Perform AppleScript:

tell application "Finder"

try

set p to (path to system folder as text) & "Preferences:Printing Prefs:LaserWriter 8 Prefs"

set name of file p to "LaserWriter 8 PrefsOrig"

end try

try

set p to (path to system folder as text) & "Preferences:Printing Prefs:LaserWriter 8 PrefsT2"

set name of file p to "LaserWriter 8 Prefs"

end try

end tell

The second will change them back after printing:

Perform AppleScript:

tell application "Finder"

try

set p to (path to system folder as text) & "Preferences:Printing Prefs:LaserWriter 8 Prefs"

set name of file p to "LaserWriter 8 PrefsT2"

end try

try

set p to (path to system folder as text) & "Preferences:Printing Prefs:LaserWriter 8 PrefsOrig"

set name of file p to "LaserWriter 8 Prefs"

end try

end tell

I would also suggest adding Set Error Capture [On] before printing so it'll still finish the script and reset the preference files in case anything goes wrong. Also, if you want to get fancy, you can probably change the AppleScript to better handle things if there's no second preference file. In my example, it'll probably just go with whatever the defaults are.

Jeff

Excellent idea!

And much simpler than monkeying around with ppd files.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.