Re: Faxing

2006-01-29 Thread Christian Huldt

24 jan 2006 kl. 11.43 skrev Alan Fry:

As a PS,  [EMAIL PROTECTED] suggested to me [slightly  
condensed]:-



Well, I'd skip the Perl - applescript - Terminal - bash hoopla
why not just use system(efax command line) or just back-ticks.


Indeed that's much better, faster, and cleaner, and works fine.



how about using convert for producing the tiffs?

I think there is a version included in Mac OS X, but since I tend to  
install imagemagick myself at some point I should not  make any  
promises...


Re: Faxing

2006-01-25 Thread Robert Whittle
 everything you might want to do from within  
Perl can be done quite simply by firstly using 'gs' to convert the  
file to faxable format and sending the fax by 'efax'. In both cases  
a suitable shell script can be invoked from within a perl script by  
an AppleScript 'do script' command.


I hope this may be of interest to some with my apologies to those  
not interested in faxing from Perl for his long spiel.


Alan Fry

On 18 Jan 2006, at 09:10, Robert Whittle wrote:

I managed to get perl to send faxes using the 'fax' front-end  
program, but never satisfactorily. I had to use root user to send  
faxes and I never managed to send any faxes that has graphics in  
the. In the end I installed PageSender, which has examples of  
sending faxes via AppleScript, and I called the AppleScript from  
perl. I know that sounds a  lot more round-about but it had a lot  
of advantages for me. I could send HTML files, correctly formated,  
and there is a record kept which you can view in the GUI of all  
faxes send, or not.


If you do get something working, I'd  be very interested to know  
how you got it done


Robert Whittle


On 18 Jan 2006, at 08:29, Dominic Dunlop wrote:


On 2006–01–17, at 20:29, Bill Stephenson wrote:
Is there a way to fax a document using the built-in Mac OSX  
(10.3) fax feature with perl?


Well, the command-line program underlying the facility is efax.  
There's also a simplified front-end program, fax. You could try  
calling either of those with system() or whatever. Alternatively,  
CUPS makes the fax modem visible as a printer once it's  
configured -- run  lpinfo -v  and you should see it listed. This  
means that you should be able simply to pipe the stuff you want  
to fax to lpr. The trick would be to work out what option you  
need to put on the command line in order to get the number  
dialled, and acceptable formats for the data. (Text is probably  
OK. Beyond that, I've no idea.)


Not that I've tried either possibility myself.


I want to write a script that faxes selected members of congress  
my humble opinions ;)


A laudable aim.
--
Dominic Dunlop









Re: Faxing

2006-01-25 Thread Alan Fry


On 25 Jan 2006, at 10:32, Robert Whittle wrote:

Thanks for the detailed and useful info provided. When using the  
efax approach described, is there any record available anywhere  
that tells you whether or not the fax was successfully sent or not?  
Options to retry if the number is busy ?


There are return codes from 'efax' which tell you what transpired:

0   The fax was successfully sent or received.

	1	The dialed number was busy or the modem device was in use. Try  
again later.


	2 	Something failed (e.g. file not found or disk full). Don’t retry.  
Check the session log for more

details.

	3 	Modem protocol error. The program did not receive the expected  
response from the modem.
		The modem may not have been properly initialized, the correct -o  
options were not used, or a

bug report may be in order. Check the session log for more 
details.

	4 	The modem is not responding. Operator attention is required.  
Check that the modem is turned

on and connected to the correct port.

5   The program was terminated by a signal.

I guess one would have to handle the return codes appropriately in  
the perl script.


This, and much more information on the capabilities of 'efax' are all  
to be found in the 'man pages': type 'man efax' into the Terminal  
window.


HTH



Re: Faxing

2006-01-24 Thread Alan Fry


On 23 Jan 2006, at 17:34, Bill Stephenson wrote:


On Jan 23, 2006, at 5:09 AM, Alan Fry wrote:

I was intrigued by the original question and have done some  
experiments on this G4 running Mac OS X 10.4.4.


snip


Wow, thanks for sharing what you've learned! Admittedly, I haven't  
had much time to play with this since I asked that question but  
your reply puts me way ahead of where I was then. I'd also like to  
thank everyone else that replied. If I get my Fax the House  
script finished I'll post a copy of it.


As a PS,  [EMAIL PROTECTED] suggested to me [slightly condensed]:-


Well, I'd skip the Perl - applescript - Terminal - bash hoopla
why not just use system(efax command line) or just back-ticks.


Indeed that's much better, faster, and cleaner, and works fine.

Many thanks for your kind remarks. I look forward to seeing Fax the  
House in due course.


Alan


Re: Faxing

2006-01-23 Thread Alan Fry
 be of interest to some with my apologies to those  
not interested in faxing from Perl for his long spiel.


Alan Fry

On 18 Jan 2006, at 09:10, Robert Whittle wrote:

I managed to get perl to send faxes using the 'fax' front-end  
program, but never satisfactorily. I had to use root user to send  
faxes and I never managed to send any faxes that has graphics in  
the. In the end I installed PageSender, which has examples of  
sending faxes via AppleScript, and I called the AppleScript from  
perl. I know that sounds a  lot more round-about but it had a lot  
of advantages for me. I could send HTML files, correctly formated,  
and there is a record kept which you can view in the GUI of all  
faxes send, or not.


If you do get something working, I'd  be very interested to know  
how you got it done


Robert Whittle


On 18 Jan 2006, at 08:29, Dominic Dunlop wrote:


On 2006–01–17, at 20:29, Bill Stephenson wrote:
Is there a way to fax a document using the built-in Mac OSX  
(10.3) fax feature with perl?


Well, the command-line program underlying the facility is efax.  
There's also a simplified front-end program, fax. You could try  
calling either of those with system() or whatever. Alternatively,  
CUPS makes the fax modem visible as a printer once it's configured  
-- run  lpinfo -v  and you should see it listed. This means that  
you should be able simply to pipe the stuff you want to fax to  
lpr. The trick would be to work out what option you need to put on  
the command line in order to get the number dialled, and  
acceptable formats for the data. (Text is probably OK. Beyond  
that, I've no idea.)


Not that I've tried either possibility myself.


I want to write a script that faxes selected members of congress  
my humble opinions ;)


A laudable aim.
--
Dominic Dunlop







Re: Faxing

2006-01-23 Thread Bill Stephenson

On Jan 23, 2006, at 5:09 AM, Alan Fry wrote:

I was intrigued by the original question and have done some 
experiments on this G4 running Mac OS X 10.4.4.


snip


Wow, thanks for sharing what you've learned! Admittedly, I haven't had 
much time to play with this since I asked that question but your reply 
puts me way ahead of where I was then. I'd also like to thank everyone 
else that replied. If I get my Fax the House script finished I'll 
post a copy of it.


Kindest Regards,

--
Bill Stephenson



Re: Faxing

2006-01-18 Thread Robert Whittle
I managed to get perl to send faxes using the 'fax' front-end  
program, but never satisfactorily. I had to use root user to send  
faxes and I never managed to send any faxes that has graphics in the.  
In the end I installed PageSender, which has examples of sending  
faxes via AppleScript, and I called the AppleScript from perl. I know  
that sounds a  lot more round-about but it had a lot of advantages  
for me. I could send HTML files, correctly formated, and there is a  
record kept which you can view in the GUI of all faxes send, or not.


If you do get something working, I'd  be very interested to know how  
you got it done


Robert Whittle


On 18 Jan 2006, at 08:29, Dominic Dunlop wrote:


On 2006–01–17, at 20:29, Bill Stephenson wrote:
Is there a way to fax a document using the built-in Mac OSX (10.3)  
fax feature with perl?


Well, the command-line program underlying the facility is efax.  
There's also a simplified front-end program, fax. You could try  
calling either of those with system() or whatever. Alternatively,  
CUPS makes the fax modem visible as a printer once it's configured  
-- run  lpinfo -v  and you should see it listed. This means that  
you should be able simply to pipe the stuff you want to fax to lpr.  
The trick would be to work out what option you need to put on the  
command line in order to get the number dialled, and acceptable  
formats for the data. (Text is probably OK. Beyond that, I've no  
idea.)


Not that I've tried either possibility myself.


I want to write a script that faxes selected members of congress  
my humble opinions ;)


A laudable aim.
--
Dominic Dunlop





Re: Faxing

2006-01-18 Thread Adrian Hosey
On Wed, 18 Jan 2006, Robert Whittle wrote:

: I managed to get perl to send faxes using the 'fax' front-end program, but
: never satisfactorily. I had to use root user to send faxes and I never managed
: to send any faxes that has graphics in the. In the end I installed PageSender,
: which has examples of sending faxes via AppleScript, and I called the
: AppleScript from perl. I know that sounds a  lot more round-about but it had a
: lot of advantages for me.


Also, anything that supports AppleScript can be driven directly from Perl
using Mac::Glue.

-- 
...while the Japanese are unable to duplicate the American film [market] they
 can destroy it by this video cassette recorder. - Jack Valenti, 1982


Re: Faxing

2006-01-18 Thread Doug McNutt
At 13:29 -0600 1/17/06, Bill Stephenson wrote:
I want to write a script that faxes selected members of congress my humble 
opinions ;)

You can send e-mail from perl and that leads to two options:

1) Send the email to efax (sp) where it can be converted to FAX and sent  for a 
fee.

2) Don't vote for representatives who steadfastly refuse to publish an e-mail 
address. I know, they will need a clerk to read it but that's true for the FAX 
too. Joel Hefley; are you listening?
-- 

-- Love your country. But don't trust its government. --


Re: Faxing

2006-01-18 Thread Joseph Alotta

Hi Doug,

I like the idea of efax.  It seems good but costs $13/month.   That  
is a little high for me considering I send or receive about 5 faxes a  
year.  I wonder if there is another place that only charges when you  
do something?


On Jan 18, 2006, at 11:51 AM, Doug McNutt wrote:


At 13:29 -0600 1/17/06, Bill Stephenson wrote:
I want to write a script that faxes selected members of congress  
my humble opinions ;)


You can send e-mail from perl and that leads to two options:

1) Send the email to efax (sp) where it can be converted to FAX and  
sent  for a fee.


2) Don't vote for representatives who steadfastly refuse to publish  
an e-mail address. I know, they will need a clerk to read it but  
that's true for the FAX too. Joel Hefley; are you listening.


I was under the impression that all US representatives get an email  
address automatically assigned to them, whether they use it or not.






-- Love your country. But don't trust its government. --




Faxing

2006-01-17 Thread Bill Stephenson
Is there a way to fax a document using the built-in Mac OSX (10.3) fax 
feature with perl?


I want to write a script that faxes selected members of congress my 
humble opinions ;)


Kindest regards,
--
Bill Stephenson