Re: Scripting Fax Sending
Re: Scripting Fax Sending
- Subject: Re: Scripting Fax Sending
- From: Jonathan Bird <email@hidden>
- Date: Tue, 18 Nov 2003 11:04:26 -0600
Hello,
I am just working on this to be able to fax from Filemaker with FM
scripting and AppleScripting. I needed to print to a file (a .ps file),
then send the resulting file to the fax.
Fax is actually a CUPS print queue and I just needed to find the proper
command to send with a do script command in AppleScript.
The fax command, after much digging and trial and error, is:
lp -d cups_queue_name -o phone=<number> filename (-d lets you specify
the print queue to use, -o is indicating that you are sending options
to the printer, in this case the phone number to fax to.)
My fax queue name is Internal_Modem (I used 'lpstat -p -d' in the
Terminal to find the appropriate queue name) so the command I used to
fax a document from my desktop is:
lp -d Internal_Modem -o phone=222-3333 ~/Desktop/filename.ps
This sent the fax to the fax queue just like using the Fax... button on
the Print dialog. So now all I have to do is construct the appropriate
do script command in an AppleScript. (I did this in a FileMaker script
step) Also, there likely is a way to set all of the options that are
available in the Fax dialog but all I needed was to get the phone
number to the print command as I had formatted the coverpage with the
FileMaker layout.
I originally got this working with GUI scripting. Boy that was a pain,
and sloowww. Here that script is for curiosity sake:
tell application "FileMaker Pro" to activate
-- may not need to activate application
set myfaxnum to "222-3333" as text
tell application "System Events"
tell application process "FileMaker Pro"
keystroke "p" using {command down}
delay 2
click button "Fax" of UI element 4 of window "Print"
delay 2
keystroke myfaxnum as text
--set value of text field 2 of window "Print" to myfaxnum
--this did not work... by keystroke did.... go figure.
delay 1
click button "Fax" of UI element 12 of window "Print"
end tell
end tell
Regards,
Jonathan B.
On 27-Oct-03, at 4:26 PM, Christopher Jett wrote:
>
Is it possible to script the sending of faxes in Panther?
>
--
>
Christopher Jett | Jett Fuel Productions
>
email@hidden | http://www.jettfuel.net
>
(830) 798-8723 | (888) 403-JETT
>
-----------------------------------------------
>
Web Design, Web Hosting, and Custom Solutions
>
... powered by Jett Fuel
>
-----------------------------------------------
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.