November 22nd, 2009 → 9:32 am @ Adam // 2 Comments
In the following artice I will show you two methods that I have created in my solutions. If you want a list of your installed printers in FileMaker you can use a simple applescript.
I show you two methods. Each of them requires a PrinterList_Global field in your database and on the layout where you execute the script.
The script is a simple Perform Applescript command. The first method uses the print setup utility to get the printer list. You need to have a PrinterList_Global field in your database and on the layout where you execute the script:

This can be used to set the default printer on OSX.
The second option uses the lpstat OS X command to get the printer names. This will give you a different list. But the printer names this one gives can be used for the “lp” OSX command. This will be important later when we get to fax sending.

Okay, now you have the printer list. You can easily create a value list based on this, and let the user choose from it.
This is where the lp command comes in. With lp you can send a file (pdf), to a number.
The syntax is the following:
lp -d PrinterNameHere -o phone=PhoneNumberHere filepathandnameHere
You can call this from FileMaker using a do shell script AppleScript Command. I attached a sample file for printer listing, the faxing is up to you, but based on this, you can easily create it.
You can download the demo file here (right click, save as).
The material on this document is offered as is. There is no representation or warranty, expressed or implied, nor does any other contributor to this post. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.
Have questions? Need help? Send an email: adam [at] crmszoftver [dot] hu
Tags: FileMaker techniques, fmtechniques
wowismusic
1 year ago
Thanks for this wonderful tutorial!
In my case, I don’t want to have the field on my layout. Is there a way to capture the text as some kind of script result and then set the field with another script?
Adam
1 year ago
Hi!
No, you have to write in a field, no script result.
If you don’t want it to appear on the layout, you can change
set cell “PrinterList_Global” of current record to backvalue
to
set field “PrinterList_Global” of table “Table Occurrence” to backvalue
Then use the other script to work with this.
If you need further information or help, feel free to drop me a line!
Regards
Adam