[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Poco Forums • View topic - Fax printing

Fax printing

Scripting questions and ideas

Moderators: Eric, Tomas, robin, Michael

Fax printing

Postby ente » Sun Jul 25, 2010 4:00 am

Hello MarkB,
slowly I'm recovering of having not only a new workstation with windows7 but also a new server with windows 2008RP (my old one (8 years) didn't like the weather we had lately - 35 Celsius (about 95 Fahrenheit)) Which was no good for my budget...
Many things which worked fine with the old server, dont work anymore (for my old C5450 Oki has no Printer driver for 2008RP, etc, etc). Of cause there are also good things about - one is a new fax printing facilty.... They go directly to the server, tzhe server send s me a mail a filter lets me know that a fax has arrived and with the help of an old MarkB script (the one you wrote for some bill arriving within an attachment) it shows up on my sceen and I can print it (or not if it's trash).
It works fine - almost fine: After anouncing, that a fax has arrived, I get the message that this is no TIF file, even when it is one. So there must be somewhere hidden a command, which I have not correctly adapted. Can you tell me where?
Here is how it looks:

{ ABC Fax Script
( Feedback version
( Redefine the $docname variables as needed
Set $docname_part1 "FAX"
Set $docname_part2 ".TIF"
{ Feedback Message
{ May be removed after the filter is debugged
MessageBox "Neuer Fax ist eingetroffen, wenn Dokument offen, Druckbefehl (Ctrl-P, dann ENTER) geben, Ausdruck Götz ins Fach legen und Programm (Alt-D, B)beenden"
{ From the selected or current message, extract the full path
{ and name of the attached file, assign it to the string $a,
{ and open the file.
Set &docfound False
{Lowercase $docname_part1
Lowercase $docname_part2
ReadAttached $attachmentlist %message
TrimLines $attachmentlist
LineCount #n $attachmentlist
If #n > 0 Then EndIfNattachments
MessageBox "Faxdruck PocoScript\nERROR: this message has no attachment"
Exit
:EndIfNattachments
{ Set $t "Faxdruck PocoScript\nLIST OF ATTACHMENTS\n\n"
{ AddStrings $t $attachmentlist
{ MessageBox $t
:MainLoop
Dec #n
If #n < 0 Then EndMainLoop
GetLine $a #n $attachmentlist
Lowercase $a
{Set &b1 $docname_part1 ^ $a
Set &b2 $docname_part2 ^ $a
And &b1 &b2
Not &b1
If &b1 Then MainLoop
Set &docfound True
Call OpenDoc
Goto MainLoop
:EndMainLoop
If &docfound Then EndIfDocfound
MessageBox "Faxdruck PocoScript\nERROR: Fax not in attachment list"
Exit
:EndIfDocfound
Exit
:OpenDoc
{ Feedback Messages
FileExists &flag $a
If &flag Then FileFound
Wait 4
FileExists &flag $a
If &flag Then FileFound
Set $t "Faxdruck PocoScript\nERROR: can't find the file "
AddStrings $t $a
MessageBox $t
Exit
:FileFound
If ".TIF" ^ $a Then EndIfTIF
MessageBox "Faxdruck PocoScript\nFYI: the attachment is not a TIF document"
:EndIfTIF
{If "FAX" ^ $a Then EndIfFAX
{MessageBox "Faxdruck PocoScript\nFYI: 'Fax' is not in the document's name"
{:EndIfFAX
{ Open the document
{ The next 3 lines may be removed after the script and filter
{ have been debugged
{Set $t "Faxdruck PocoScript\nNow attempting to open the document "
{AddStrings $t $a
{MessageBox $t
Execute $a
Return


Thank you,
ente

P.S. Within the next weeks I will also look at the other versions for the mail printing with additional text. For the time being, I still use that first version
ente
Resident Poster
 
Posts: 182
Joined: Mon Sep 27, 2004 7:17 am
Location: Zurich, Switzerland

Postby MarkB » Sun Jul 25, 2010 11:40 pm

Hi, ente. Thank you for the update.

Lowercase ".TIF" here:
Code: Select all
:FileFound
If ".tif" ^ $a Then EndIfTIF
MessageBox "Faxdruck PocoScript\nFYI: the attachment is not a TIF document"
:EndIfTIF

We lowercase strings before comparisons in this script because string comparisons are case sensitive (and the original case of the file name is unknown to the script).

There may be more to say. If so, I will get back to you tomorrow. Away today.
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby ente » Mon Jul 26, 2010 1:33 am

[quote="MarkB"]

Lowercase ".TIF" here:
Code: Select all
:FileFound
If ".tif" ^ $a Then EndIfTIF
MessageBox "Faxdruck PocoScript\nFYI: the attachment is not a TIF document"
:EndIfTIF


MarkB, thank you! Only: I can't find any lowercase TIF anywhere!?
Ente
ente
Resident Poster
 
Posts: 182
Joined: Mon Sep 27, 2004 7:17 am
Location: Zurich, Switzerland

Postby MarkB » Mon Jul 26, 2010 8:49 am

What I meant was, change ".TIF" to ".tif". That is, change
Code: Select all
If ".TIF" ^ $a Then EndIfTIF

to
Code: Select all
If ".tif" ^ $a Then EndIfTIF


It's 30 C here, and even that is too hot for me.


Edit: Change only that one line.
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby ente » Mon Jul 26, 2010 7:46 pm

MarkB wrote:What I meant was, change ".TIF" to ".tif". That is, change
Code: Select all
If ".TIF" ^ $a Then EndIfTIF

to
Code: Select all
If ".tif" ^ $a Then EndIfTIF


It's 30 C here, and even that is too hot for me.


Edit: Change only that one line.


MarkB,
thank you. Now it works I had thought, that in the script the Filename must reflect the exact wording of the filename in the mail. And the filename is FAX.TIF
sincerely,
Ente
ente
Resident Poster
 
Posts: 182
Joined: Mon Sep 27, 2004 7:17 am
Location: Zurich, Switzerland

Postby MarkB » Fri Jul 30, 2010 2:54 am

ente, skip this post if you wish.

One section of your script intrigues me:
Code: Select all
{Set &b1 $docname_part1 ^ $a
Set &b2 $docname_part2 ^ $a
And &b1 &b2


The first Set line is commented out. Therefore, immediately following the Set lines, &b1 is an undeclared variable, at least on the first pass through the loop. That will cause trouble, one would think. For example, these two scripts crash with the error messages "Variable not previously declared: &b1" and "Source variable not previously declared":
Code: Select all
MessageBox &b1

Code: Select all
Set $a &b1


Why doesn't your script crash? It turns out that the And command, in effect, declares the variable &b1 and defines it as 1 or True if it is not already declared.
Code: Select all
{ &b1 is an undeclared variable
Set &b2 1
And &b1 &b2
{ 1 And 1 = 1
MessageBox &b1

Code: Select all
{ &b1 is an undeclared variable
Set &b2 0
And &b1 &b2
{ 1 And 0 = 0
MessageBox &b1


I recommend that you uncomment that Set line and the earlier line "Lowercase $docname_part1". Otherwise, the TIF file may not print if there happens to be a second attachment that is not a TIF -- because on second and subsequent passes through the loop, &b1 will start with whatever value it was assigned on the previous pass.
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby ente » Fri Jul 30, 2010 11:24 pm

MarkB wrote:ente, skip this post if you wish.


MarkB,

I think this was ment as a joke? Of course I hurried and changed the script according to your reccomendation!

...and I hurry on and send you the basis of the the fax printing script and kindly ask you to go through that aswell (see below).

Once more thank you very much and a wonderfull Sunday,

ente


{ ABC ZVAB Script
( Feedback version
( Redefine the $docname variables as needed
Set $docname_part1 "mahnung"
Set $docname_part2 ".pdf"
{ Feedback Message
{ May be removed after the filter is debugged
MessageBox "PocoScript ZVab rechnung läuft, wenn Dokument offen, Druckbefehl geben, Ausdruck Götz ins Fach legen und Programm beenden"
{ From the selected or current message, extract the full path
{ and name of the attached file, assign it to the string $a,
{ and open the file.
Set &docfound False
{Lowercase $docname_part1
Lowercase $docname_part2
ReadAttached $attachmentlist %message
TrimLines $attachmentlist
LineCount #n $attachmentlist
If #n > 0 Then EndIfNattachments
MessageBox "Phone bill PocoScript\nERROR: this message has no attachment"
Exit
:EndIfNattachments
{ Set $t "Phone bill PocoScript\nLIST OF ATTACHMENTS\n\n"
{ AddStrings $t $attachmentlist
{ MessageBox $t
:MainLoop
Dec #n
If #n < 0 Then EndMainLoop
GetLine $a #n $attachmentlist
Lowercase $a
{Set &b1 $docname_part1 ^ $a
Set &b2 $docname_part2 ^ $a
And &b1 &b2
Not &b1
If &b1 Then MainLoop
Set &docfound True
Call OpenDoc
Goto MainLoop
:EndMainLoop
If &docfound Then EndIfDocfound
MessageBox "Phone bill PocoScript\nERROR: phone bill not in attachment list"
Exit
:EndIfDocfound
Exit
:OpenDoc
{ Feedback Messages
FileExists &flag $a
If &flag Then FileFound
Wait 4
FileExists &flag $a
If &flag Then FileFound
Set $t "Phone bill PocoScript\nERROR: can't find the file "
AddStrings $t $a
MessageBox $t
Exit
:FileFound
If ".pdf" ^ $a Then EndIfPdf
MessageBox "Phone bill PocoScript\nFYI: the attachment is not a PDF document"
:EndIfPdf
{If "mahnung" ^ $a Then EndIfMahung
{MessageBox "Phone bill PocoScript\nFYI: 'mahnung' is not in the document's name"
{:EndIfMahung
{ Open the document
{ The next 3 lines may be removed after the script and filter
{ have been debugged
{Set $t "Phone bill PocoScript\nNow attempting to open the document "
{AddStrings $t $a
{MessageBox $t
Execute $a
Return
ente
Resident Poster
 
Posts: 182
Joined: Mon Sep 27, 2004 7:17 am
Location: Zurich, Switzerland

Postby MarkB » Sat Jul 31, 2010 5:04 am

I remember that script from several years ago. A short script never worked for you, even after much effort, so you received this long script full of diagnostics and attempts to forestall problems. The original purpose was to print a file named mahnung.pdf, to which name Poco might have added an unknown suffix (mahnungxxxxx.pdf).

If that is still the purpose, you should uncomment these two lines:
Code: Select all
{Lowercase $docname_part1

Code: Select all
{Set &b1 $docname_part1 ^ $a


However, if you commented out those two lines in order to modify the script so that it will print any PDF document, not just mahnung.pdf, then do nothing. It's working for you. Or you could take care of the undeclared variable issue, in case Poco someday repairs the bug in And, by replacing
Code: Select all
{Set &b1 $docname_part1 ^ $a

with
Code: Select all
{ORIGINALLY: Set &b1 $docname_part1 ^ $a
Set &b1 1


CHANGE OF TOPIC

You originally wanted fully automatic printing, I think, but your PDF viewer at that time had disabled the printing command-line option, so your script merely opened the file with Execute $a. Are you still interested in full auto mode? I ask because I have just recently had occasion to script Poco to silently print PDF documents. It wouldn't take much to get you going. I use PDF-XChange Viewer, but I hear that newer versions of Foxit Reader have re-enabled the /p (print) command line option.
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby ente » Mon Aug 02, 2010 2:27 am

MarkB wrote:I remember that script from several years ago. A short script never worked for you, even after much effort, so you received this long script full of diagnostics and attempts to forestall problems. The original purpose was to print a file named mahnung.pdf, to which name Poco might have added an unknown suffix (mahnungxxxxx.pdf).

If that is still the purpose, you should uncomment these two lines:
Code: Select all
{Lowercase $docname_part1

Code: Select all
{Set &b1 $docname_part1 ^ $a


However, if you commented out those two lines in order to modify the script so that it will print any PDF document, not just mahnung.pdf, then do nothing. It's working for you. Or you could take care of the undeclared variable issue, in case Poco someday repairs the bug in And, by replacing
Code: Select all
{Set &b1 $docname_part1 ^ $a

with
Code: Select all
{ORIGINALLY: Set &b1 $docname_part1 ^ $a
Set &b1 1


CHANGE OF TOPIC

You originally wanted fully automatic printing, I think, but your PDF viewer at that time had disabled the printing command-line option, so your script merely opened the file with Execute $a. Are you still interested in full auto mode? I ask because I have just recently had occasion to script Poco to silently print PDF documents. It wouldn't take much to get you going. I use PDF-XChange Viewer, but I hear that newer versions of Foxit Reader have re-enabled the /p (print) command line option.


MarkB, good evening,
thank you very much. I have uncommented the two lines. It had worked the other way also, but may be it will work now even better...

Of course it would be nice to have this docoment printed automatically, even so it is no hard work to hit Ctrl-P. For the time being, I have only AdobeReader installed. Foxit went with my old workstation... Would it work also with Adobe or shall I get PDF-Xchange?

But there is another PDF I would like to have printed silentlly. But this might be to complex.
This is how it gets here:

1) A mail lets me know the the invoice is ready and that I should go and get it at a specific Webpage.

2) I go to that page and there I have to enter username and password.

3) A page opens and shows a list with PDF documents On top the newest (which I have to have), at the bottom the oldest.

4) I select the top document, it opens and I make Ctrl-P

Thanks once more,
ente
ente
Resident Poster
 
Posts: 182
Joined: Mon Sep 27, 2004 7:17 am
Location: Zurich, Switzerland

Postby MarkB » Tue Aug 03, 2010 7:00 am

ente, I'll get back to you re. your latest post. I've been wasting time by putting myself into a panic over file names in PocoScript. This arises once every few years. What happens if the file name contains "\n"?

-----------

A reminder demo

Email the file Norway.pdf to yourself. Adjust the path in the first line of the script if you wish. Copy that full file spec. Then run this script against the received message.

Code: Select all
Set $a "C:\Users\Mark\AppData\Roaming\Pocomail\Attach\Norway.pdf"
MessageBox $a
{   Result: two lines - no usable file name for Execute, FileExists.
{   Line 1:  C:\Users\Mark\AppData\Roaming\Pocomail\Attach
{   Line 2:  orway.pdf
{   \N is interpreted as a cariage return + line feed.

ReadAttached $a %message
MessageBox $a
{   Result: one line - our file name.
{   C:\Users\Mark\AppData\Roaming\Pocomail\Attach\Norway.pdf

Set $b $a
MessageBox $b
{   Result:  still a usable file name

PasteFromClipboard $a
MessageBox $a
{   Result:  usable file name

ReadHeader $a "X-Poco-Attachment:" %message
MessageBox $a
{   Result:  usable file name

Embed $a "EndEmbed"
C:\Users\Mark\AppData\Roaming\Pocomail\Attach\Norway.pdf
EndEmbed
MessageBox $a
{   Result:  literal

Set $a "You never know"
InsertString $a 5 \
MessageBox $a
{   Result:  literal

InputBox $a "Type something with a backslash-n in it"
MessageBox $a
{   Result:  literal

Set $a ""
AddStrings $a "Answer Yes\No"
MessageBox $a
{   Result:  interpreted (as CRLF)


Is it safe to assume that in strings not built by Set and AddStrings the special string sequences will be taken literally? Who knows! It might be nice to have a command switch that would explicitly guarantee that special string sequences will be taken literally.
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby ente » Wed Aug 04, 2010 4:08 am

MarkB wrote:ente, I'll get back to you re. your latest post. I've been wasting time by putting myself into a panic over file names in PocoScript. This arises once every few years. What happens if the file name contains "\n"?

-----------

A reminder demo

Email the file Norway.pdf to yourself. Adjust the path in the first line of the script if you wish. Copy that full file spec. Then run this script against the received message.

(...)

Is it safe to assume that in strings not built by Set and AddStrings the special string sequences will be taken literally? Who knows! It might be nice to have a command switch that would explicitly guarantee that special string sequences will be taken literally.


MarkB,
thank you. Please don't panic! Especially because I can't help you out! And because me - and most probably many others - would miss you and your macros...
I run the script against a mail I had send me with a attachment called norway.pdf and I was asked to type something in after a backslash - what I did.
If one uses a filter and a script which opens any .pdf, this might cause problems. But since Eric told me - see the exchange I had with him conserning an AV which blocked Poco after I had added another filter (I have about 90) that he has many more - to keep filters small, I will create very specific filters for the senders which send on a more or less regular basis .pdf. That means, In the filter I give a defined sender and a defined subject and then call for your script. All ther other pdfs will be handled the slow way.
Have a nice day,
ente
ente
Resident Poster
 
Posts: 182
Joined: Mon Sep 27, 2004 7:17 am
Location: Zurich, Switzerland

Postby MarkB » Thu Aug 05, 2010 1:01 am

ente, if you want to try this PrintPdf routine, first test the following script by itself. Then if you want to use it, see "USING THE SCRIPT" below. For testing, add a temporary line to the top of the script defining $a as any test PDF file (make sure that there is no \N in the path). If you are not interested, don't worry about it -- the script was already written.

ADOBE READER

I don't have Adobe Reader, haven't had for many years, and I really don't want to install it on my PC. One instance of Reader will always be left open, even with the /t option, according to one of the references. You can experiment with Adobe if you wish:
Correct the address for Adobe Reader ($pdf_viewer), which seems to change with every new version.
Run the script.
If it doesn't work, try defining $pdf_printername (near the top of the script) as the name of your printer (go to Control Panel | Devices and Printers and copy the exact name from Properties).

PDF-XCHANGE VIEWER

This section should be ready to use. With showui=no, the viewer opens hidden, starts the print job, and closes. Multiple documents in succession are OK. Set $pdf_printername (near the top) to blank to print to the default printer.

If you install PDF-XChange Viewer, the script should find it automatically and use it, and ignore Adobe Reader if present. Licence issues are up to you.

If you install PDF-XChange Viewer then, as always, deselect all additional software, toolbars, start pages, etc., that it might want to install. In Preferences, verify the following:
- under Security, set to "Always ask" or "Never"
- under JavaScript, uncheck "Enable JavaScript"
- under Search Providers, check "Switch off all search providers"

USING THE SCRIPT

Remove the temporary Set $a line that you added. If you want to use this PrintPdf routine, you could replace the line Execute $a in the old script with this entire PrintPdf script.

[code]
Set $pdf_filename $a
Set $pdf_printername ""
{---------------------------------------------------------------------
{ PrintPdf
{ DESCRIPTION: Prints a PDF file
{ REQUIRES: $pdf_filename, $pdf_printername (may be blank)
{ CHANGES: $pdf_command, $pdf_viewer, &pdf_flag, $space, $qmark, $t
{ Evidently the string of command line options may contain spaces without
{ needing enclosing q-marks.
{ Evidently the special sequences \n, \N and \\ are not interpreted when
{ $pdf_filename is obtained via ReadAttached-GetLine.

Set $space " "
Set $qmark "\""

{ Check that the doc exists
FileExists &pdf_flag $pdf_filename
If &pdf_flag Then EndIfPdfDocExists
Set $t ""
AddStrings $t "The PocoScript '" $PocoScriptName "' can't find the file\N" $pdf_filename
MessageBox $t
Goto EndPrintPdf
:EndIfPdfDocExists

{ PDF-XChange Viewer
{ - tested with PDFX v2.0, Poco 4.8, Win7-64 on 2010-06
{ - program path for the 64-bit version is "Program Files"
{ - set $pdf_printername to blank for default printer
{ - one space between print options and file name
{ - showui=yes/no - defines whether progress is shown
{ - showui=no - Viewer runs hidden; closes after printing
{ - PDFX wants printer name in q-marks in case it contains spaces or &
Set $pdf_viewer "C:\Program Files\Tracker Software\PDF Viewer\PDFXCview.exe"
FileExists &pdf_flag $pdf_viewer
If &pdf_flag Then GotPdfx
Goto DonePdfx
:GotPdfx
Set $pdf_command "/print:showui=no"
AddStrings $pdf_command $space $qmark $pdf_filename $qmark
If $pdf_printername = "" Then OpenPdfx
Set $pdf_command "/printto:showui=no"
AddStrings $pdf_command $space $qmark $pdf_printername $qmark $space $qmark $pdf_filename $qmark
:OpenPdfx
Goto PrintThePdf
:DonePdfx

{ Adobe Reader
{ Not tested
{ AcroRd32.exe /p pathname â€â€
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Script: send to all

Postby ente » Wed Nov 03, 2010 5:04 am

Hello MarkB,

I tried to create a new Topic, but got the following error message:

SQL Error : 1062 Duplicate entry '7783' for key 1

INSERT INTO phpbb_topics (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('Script: send to all', 833, 1288801526, 8, 0, 0, 0)

Line : 227
File : functions_post.php


So I decided, to use this old one and post my question this way:

I found in the script library

send_to_all_address_book

I made a test with a simple .txt file - everything worked fine.

But for real I've to mail a file called nichtimmerleicht.pdf, and I find no way to enter that filename in thet script so that this pdf gets mailed with the message
What I'm doing wrong?
ente
ente
Resident Poster
 
Posts: 182
Joined: Mon Sep 27, 2004 7:17 am
Location: Zurich, Switzerland

Postby MarkB » Wed Nov 03, 2010 6:52 am

Hi, ente.

What you need to do is give the script a file name for the attachment and then attach that file to your messages. So...

Insert these lines just after your External commands (note the double backslash in the file name):
Code: Select all
Set $attachment "C:\Users\Ente\AppData\Roaming\Pocomail\Scripts\\nichtimmerleicht.pdf"

FileExists &flag $attachment
If &flag Then AttachmentExists
Set $t ""
AddStrings $t "The PocoScript " $PocoScriptName " can't find the file\n" $attachment
MessageBox $t
Exit
:AttachmentExists

FileExists &flag $userfile1
If &flag Then BodyFileExists
Set $t ""
AddStrings $t "The PocoScript " $PocoScriptName " can't find the file\n" $userfile1
MessageBox $t
Exit
:BodyFileExists


And insert the following lines just before SaveMessage:
Code: Select all
{  The next script line added 2010-11
AttachFile %m $attachment


I haven't tested those, but...
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby MarkB » Wed Nov 03, 2010 7:01 am

Oops. Sorry. Cut this bit:
Code: Select all
FileExists &flag $userfile1
If &flag Then BodyFileExists
Set $t ""
AddStrings $t "The PocoScript " $PocoScriptName " can't find the file\n" $userfile1
MessageBox $t
Exit
:BodyFileExists
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Next

Return to PocoScript Help and How-To

Who is online

Users browsing this forum: No registered users and 3 guests

cron