To all,
Ben Waldie, of Automated Solutions, just posted this for me in another
forum. Because this emulates the human intervention in the GUI, it works
... and I thought I would pass it along.
The PDF idea is something that Tim Mansour suggested on this list as well.
Thanks everyone!
Neil
-----------------------------------------------------------
Neil,
I just did a quick test...
tell application "Printer Setup Utility"
set current printer to printer "HP Laser"
end tell
tell application "FileMaker Pro"
print window 1 with copies 5
end tell
... and confirmed that FileMaker does indeed use the last printer that was
used, and not necessarily the printer that I have specified in the "Printer
Setup Utility". To work around this issue, here are some suggestions...
a) You could use GUI scripting to simulate user interaction to select the
printer and type the number of copies into the print dialog. For example:
tell application "System Events"
tell process "FileMaker Pro"
set frontmost to true
keystroke "p" using command down
repeat until window "Print" exists
end repeat
tell window "Print"
keystroke "20" -- number of copies
tell pop up button 3
click
tell menu 1
click menu item "HP Laser" -- Your printer name
end tell
end tell
keystroke return -- depress the "Print" button
end tell
end tell
end tell
b) You could create a FileMaker script step that prints the layout to PDF,
and then have AppleScript take over, open the PDF in something, such as
Adobe Acrobat Professional, and print it X number of times from there.
Hope this helps.
-Ben