Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the '10.3: Fax from command line (or AppleScript)' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: Fax from command line (or AppleScript)
Authored by: fenner on Dec 05, '03 01:00:49PM
While writing an Apple FAX to HylaFAX gateway, I came across the following other options:

-o faxCoverSheet
-o faxSubject="Subject of the FAX"
-o faxCoverSheetMessage="Message for cover sheet"
-o faxTo="Person Receiving FAX"
To be honest, I haven't played with Apple's built-in FAX sending and receiving, only the ability to queue to a remote FAX server. Some of my work (including the PPD and instructions for queueing FAXes to a remote Panther FAX server) is available at I'm interested in feedback from others since so far it's just been me experimenting with this.

[ Reply to This | # ]
plain text to postscript
Authored by: macubergeek on Dec 07, '03 12:04:19PM

I'm guessing this hint requires that you have a text file in .ps or postscript form. How do you convert plaintext-->postscript?

[ Reply to This | # ]
10.3: Fax from command line (or AppleScript)
Authored by: buzzdk on Dec 08, '03 06:46:07AM

I am having great dificulties with the cover sheet. Only the first word of faxSubject, faxCoverSheetMessage & faxTo are being transfered :-/

Anyone got a solution?

[ Reply to This | # ]
10.3: Fax from command line (or AppleScript)
Authored by: fenner on Dec 08, '03 10:58:13AM
Try URL encoding the options, e.g.

-o faxSubject="Hello%20my%20dear%20fax%20destination"
Sorry that I forgot this detail in my original followup.

[ Reply to This | # ]
Elaborate a bit...please
Authored by: jbc on Jan 07, '04 11:34:50PM

You say "I came across the following other options". Where?

I just installed Panther this week, and I'm looking at trying to replace an automated fax script using efax with using Apple's Fax from a shell script. Currently I have to enable "at" in the crontab in order to schedule faxes to go out at night. Is a setting for Apple's Fax Scheduler listed among the options you found?

[ Reply to This | # ]
10.3: Fax from command line (or AppleScript)
Authored by: bugugly on Mar 10, '05 02:44:53PM
Great stuff. Used your info and some php to create a www fax server that requires only a web browser to send faxes from our central server machine.

//make a file for testing, real world just pass in the filename
//and run from efix creation on down
$filename = date("ymdHis");
//create a file with no extension, extensions are hard to work with in efix
if ($newfile = fopen(FAX_FILE_LOCATION.$filename,"x"))//x for new file, fails if file exists
	fwrite($newfile,"Making faxes baby!  From your friendly neighborhood WWW fax server! \n \n $filename");
	print("Could not create file, check permissions or file already exists");

/**********Now efix to create a tiff G3 doc***********/
/**********see man efix for details******************/

$do_efix = exec("efix -n".FAX_FILE_LOCATION.$filename.".%03d ".FAX_FILE_LOCATION.$filename, $output, $returnValue);

if ($returnValue == 0)
  $faxnum = '5555555555';
  /**Not sure if I need a wait state in here before setting up the fax**/
  print("<br>Fax starts in 5 seconds.....<br>");
  sleep(5);//just in case, give efix a little time
  //thanks to for lp -d -o stuff
  $dofax = exec("lp -d Internal_Modem -o phone=$faxnum ".FAX_FILE_LOCATION.$filename.".001",$output, $returnValue);
  //view results for debugging
  print("<br><hr>WWW fax server results: <br>\n");
  foreach ($output as $line)
  if ($returnValue== 0) {
  	print("<br>If you see a request ID your fax was successfully submitted with the job name listed under result. \n");
  	print("<br>Administrators can view this job from WWW by viewing CUPS print queue.");
    else print("<br>Error submitting fax job, make note of results listed above");


[ Reply to This | # ]