[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 - job for filter or script needed?

job for filter or script needed?

Scripting questions and ideas

Moderators: Eric, Tomas, robin, Michael

Re: script or filter

Postby Michael » Sat Aug 12, 2006 6:10 am

ente wrote:Hello Mark & Michael,
I feel flattered, now also the boss jumps in...


PS: I am not the boss. While it's true that I live in the same city as the developer I am not employed by Poco Systems Inc. although I am a very satisfied customer of theirs.
Michael
Moderator
 
Posts: 866
Joined: Mon Jul 26, 2004 12:14 pm
Location: Victoria BC, Canada

Re: script or filter

Postby ente » Sat Aug 12, 2006 10:11 am

Michael wrote:
ente wrote:Hello Mark & Michael,
I feel flattered, now also the boss jumps in...


PS: I am not the boss. While it's true that I live in the same city as the developer I am not employed by Poco Systems Inc. although I am a very satisfied customer of theirs.


Mark, Michael,
it's short from midnight - and I'm at home, where I don't have that mail with that file. So I tried with some other mail with a message.

This is what I did - with success!

Code: Select all
gperll AT datacomm.ch,From,dialog,"Kassenfile ist da!",0,0,,and,1,"ABC-Kasse 2005.xls",X-Poco-Attachment,move,Draft,0,0,,1,,,dialog,"Jetzt ist es editierbereit",0,0,,0,,,move,In,0,0,,0,,,move,In,0,0,,0,,,move,In,0,0,1,0


I found the file, let it give the first message, moved it then to draft and let me have another message announcing the move.

That sounds like I made something wrong at the office... I wonder what! Because creating the filter, I always first selected the message, so that in the file creating window I did not have to type addresses or so but just could select them, and the attachment's file name I had copied to be sure to have no typing differences.

Michael, with Boss I had ment Boss of this particular forum. And, me to, I'm very satisfied with Poco. Some find my preaching for Poco almost ennoying. I became using Poco when I wanted - in vain - to make a backup of my mails with Outlook... That was in the late 90ies.

I'll let you have news as soon as I'm back at the office. Götz (=Ente)


~ Masked email address to prevent harvesting + added Code tags ... Eric ~
ente
Resident Poster
 
Posts: 182
Joined: Mon Sep 27, 2004 7:17 am
Location: Zurich, Switzerland

Postby ente » Fri Aug 18, 2006 11:57 pm

Hello Mark and Michael,

I not only put the sleeves up, I worked without shirt at all (almost). Now I'm (almost) sure that it is not me but Pocomail: It does not find an attachment when installed on a server.
(I have the program on drive Q:\ and the data on drive P: and I'm working on workstation C:\ or A:\.

With a Filter only looking for a mail from Sender X and asking for a message, I get any Message I want. When I add to that filter the argument and X-Poco-Attachment attachment, Poco stays silent.

I tried with different attachments (pdf and xls), I also changed the path for the attachments from P: to Q: that did not help either.

What do you suggest? Götz

Here the different filter settings:
[Incoming]
perll@abc-buch.ch,From,dialog,"XLS ist da",0,0,,and,0,"ABC-Kasse 2003.xls",X-Poco-Attachment,move,In,0,0,,0,,,move,In,0,0,,0,,,move,In,0,0,,0,,,move,In,0,0,,0,,,move,In,0,0,1,0
orderreminder@ilab-lila.com,From,dialog,"meldung ilab ist da",0,0,,,0,,,move,In,0,0,,0,,,move,In,0,0,,0,,,move,In,0,0,,0,,,move,In,0,0,,0,,,move,In,0,0,1,0
gperll@datacomm.ch,From,dialog,"Mahnung ist von gpl da!",0,0,,,0,Mahnung.pdf,x-Poco-Attachment,move,In,0,0,,0,,,move,In,0,0,,0,,,move,In,0,0,,0,,,move,In,0,0,,0,,,move,In,0,0,1,0

Shall I mail you my .ini?
ente
Resident Poster
 
Posts: 182
Joined: Mon Sep 27, 2004 7:17 am
Location: Zurich, Switzerland

Postby MarkB » Sat Aug 19, 2006 1:33 am

I not only put the sleeves up, I worked without shirt at all (almost).
:-)

Perhaps someone with experience with Poco and server files will have some insight to share, if that is a problem. In the meantime, could we have a look, please? Either copy the X-Poco-Attachment lines from your test message and paste them here or run the following script on the test message and paste the results here.

Code: Select all
{ ScriptInfo
{
{ DESCRIPTION
{    This script obtains some information about PocoMail
{    and the selected message and copies it to Windows
{    Clipboard.
{
{ SETUP
{    1. Copy this script to Notepad.
{    2. Save it in PocoMail's Scripts folder with the
{       name ScriptInfo.poc.
{    3. Close and re-open PocoMail.
{
{ USAGE
{    1. Select a message in PocoMail.
{    2. Run ScriptInfo via PocoMail's Tools menu.
{    3. Paste


Set $msg "ScriptInfo"
GetDate $date
GetTime $t
AddStrings $msg " - " $date ", " $t "\n"


AddStrings $msg "\nAPP\n"
AddStrings $msg "Version: " $PocoVersion "\n"
AddStrings $msg "Build: " #PocoVersion "\n"
AddStrings $msg "App path: " $apppath "\n"
AddStrings $msg "Attach path: " $attachpath "\n"
AddStrings $msg "CurrentMailbox: " $CurrentMailbox "\n"


AddStrings $msg "\nATTACHMENTS" "\n"
ReadAttached $attachmentlist %message
TrimLines $attachmentlist
LineCount #n $attachmentlist
AddStrings $msg "No. of attachments: " #n "\n"
If #n < 1 Then EndIfNattachments
AddStrings $msg $attachmentlist "\n"
:EndIfNattachments


AddStrings $msg "\nSCRIPT\n"
AddStrings $msg "PocoScript Mode: " #PocoScriptMode "\n"


CopyToClipboard $msg
MessageBox $msg
[/code]
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby ente » Sat Aug 19, 2006 2:10 am

ScriptInfo - 19.08.2006, 16:05:25

APP
Version: 3000
Build: 3000
App path: Q:\Programme\PocoMail\
Attach path: P:\ABC\Pocomail\Attach\
CurrentMailbox: In

ATTACHMENTS
No. of attachments: 1
P:\ABC\Pocomail\Attach\Mahnung-Aug19-1.pdf


SCRIPT
PocoScript Mode: 5



Here is the info.
But: It might be that I have to be happy that I've the shirt off - so that I can hide from myself (and you and all the others). I think I have found the (=my) error. I'll let you know as soon as I'm through with re-testing filter & script.

Götz
ente
Resident Poster
 
Posts: 182
Joined: Mon Sep 27, 2004 7:17 am
Location: Zurich, Switzerland

Postby MarkB » Sat Aug 19, 2006 4:27 am

ente wrote:ScriptInfo - 19.08.2006, 16:05:25

APP
Version: 3000
Build: 3000
App path: Q:\Programme\PocoMail\
Attach path: P:\ABC\Pocomail\Attach\
CurrentMailbox: In

ATTACHMENTS
No. of attachments: 1
P:\ABC\Pocomail\Attach\Mahnung-Aug19-1.pdf


SCRIPT
PocoScript Mode: 5



Here is the info.
But: It might be that I have to be happy that I've the shirt off - so that I can hide from myself (and you and all the others). I think I have found the (=my) error. I'll let you know as soon as I'm through with re-testing filter & script.

Götz

Notice that the attachment's file name is not mahnung.pdf. You will have to do the filter search in two parts, as I suggested earlier:

Search X-Poco-Attachment for .pdf
and
Search X-Poco-Attachment for mahnung
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby MarkB » Sat Aug 19, 2006 4:37 am

Also, please test the filter and script with this long version of the phone bill script:

Code: Select all
{ Ente's Phone Bill 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 "The phone bill PocoScript is running"

{ 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
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby ente » Sat Aug 19, 2006 5:37 am

ente wrote: shirt off - (and knickers down)
(':oops:')

Of course it was not Poco's fault but mine. Of course Poco finds files also in a network environment.

My first fault: the attachment directory was overcrowded.

The 2nd: After re-install and changing for testing the directory for attachments, I had selecteted in the dropdown menu address instead of attach.

And under certain conditions, e.g. when firefox is open and running in full size, the PDF reader does not come in front when called, but stays behind and so I oversaw it.

Now that phone bill script runs just perfect. The only thing left for me: hit Ctrl-P. And, unfortunately, I also have to pay the bill myself...
And afterwards I have to move the PDF file into the appropriate directory

Many thanks, Mark and Michael, Götz

In case you come to Zürich: Just around the corner is a real good italian restaurant

P.S. The long version of the script should be placed in the open script library. I'm sure there are many other for which it would come handy!
ente
Resident Poster
 
Posts: 182
Joined: Mon Sep 27, 2004 7:17 am
Location: Zurich, Switzerland

Postby MarkB » Sun Aug 20, 2006 5:40 am

In case you come to Zürich: Just around the corner is a real good italian restaurant

Image

The script is certainly not pretty, and it's not general-purpose. But if it's working for you, I'm afraid to touch it (change it) again.
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby ente » Sun Aug 20, 2006 6:43 am

The script is certainly not pretty, and it's not general-purpose. But if it's working for you, I'm afraid to touch it (change it) again


For me a script is pretty, when it does it's job, and it becomes general-purpose as soon as it's steps are so easy to understand, that even someone like me becomes able to adapt it to differend needs.

I use on a daily basis about 20 different scripts; all of them I have "developped" by adapting scripts found in the open script library to my needs.

Götz

P.S. Notice that the attachment's file name is not mahnung.pdf. You will have to do the filter search in two parts, as I suggested earlier
"Mahnung.pdf" becomes Mahnung-Aug19-1.pdf at August 19th as soon as it finds a file with the same name in the directory, and then Mahnung-Aug19-2.pdf etc, etc
ente
Resident Poster
 
Posts: 182
Joined: Mon Sep 27, 2004 7:17 am
Location: Zurich, Switzerland

Previous

Return to PocoScript Help and How-To

Who is online

Users browsing this forum: No registered users and 1 guest

cron