[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 - Filing mail into a specified mailbox?

Filing mail into a specified mailbox?

Scripting questions and ideas

Moderators: Eric, Tomas, robin, Michael

Filing mail into a specified mailbox?

Postby LGM » Tue May 24, 2005 12:36 pm

How do I create a script to file selected mail that's already in my inbox into a specified mailbox? For example, I create a mailbox called To Do. I want an easy way to move mail I select from various users and with various subject lines into this folder manually -- with a simple press of a toolbar button.

With the help of Eric, I was able to create a filter that will do this if I press CTRL+F5, but that is not as easy as simply pressing a toolbar button. And I haven't found a way to associate a filter with a button.

So is there a way to either create a script to do what I want OR to create a script that activates the filter I already created and then associate that script with a button?

Another thing I would like to associate with a toolbar button is to backup the mail from a user account into a folder I specify. I know you can set this up to be done automatically at an interval I select via menu options, but I would like to be able to do this manually at various times too.

Thanks in advance.
LGM
Poco Tourist
 
Posts: 35
Joined: Mon May 23, 2005 10:26 am

Postby Eric » Tue May 24, 2005 9:17 pm

:oops: It was late yesterday, so I didn't have time to search for more answers :
- Script for moving mail
- Script: pocobackup.poc (for registered users only)

With a little modification to the scripts, it could do exactly what you want it to do. :)

Michael, Pete or Hogyt & others can maybe add some more info to it.

Good luck. :wink:
Eric
 

Postby LGM » Wed May 25, 2005 2:32 am

Well Eric, thanks once again for your timely assistance. I looked at the source you provided and tried to create a simple script that did what I wanted, basically guessing as to what I should put in it. But this scripting language is all greek to me. So needless to say my attempt did not work. :(

First I created a mailbox called To Do. Then I created a script with the following information:


{###Move mail to To Do
{Script will move selected mail
{to the To Do mailbox

AppendToFile True
SaveMessage %message $To Do
{ Finally, deleting the original message }
DeleteMessage %message



When I tried to run the script against a selected piece of mail in my In box, a message pops up that says "SaveMessage needs 2 parameters."

Obviously something is missing or wrong. But what?
LGM
Poco Tourist
 
Posts: 35
Joined: Mon May 23, 2005 10:26 am

Postby Pete » Wed May 25, 2005 7:00 am

Something like this should work. It will move all of the currently selected messages.
Code: Select all
SaveMessage %message "To Do"
DeleteMessage %message
Pete
 

Postby LGM » Wed May 25, 2005 7:58 am

Great! That did the trick. The only hitch is that I set up To Do as a sub-mailbox of the In box. When the script ran, it apparently couldn't see the sub-mailbox so it created a new To Do mailbox.

So if my target mailbox is a sub-mailbox of another, what is the language to use for that?

Thanks.
LGM
Poco Tourist
 
Posts: 35
Joined: Mon May 23, 2005 10:26 am

Postby LGM » Wed May 25, 2005 8:10 am

Nevermind my question above. I did a search and found the answer in the archives -- "In\\To Do"


Thanks Pete and Eric for your help! :D
LGM
Poco Tourist
 
Posts: 35
Joined: Mon May 23, 2005 10:26 am

beware a problem with this script

Postby bulbous » Wed Jun 28, 2006 10:34 am

I have a script just like your 'Todo' script -- one problem you should be aware of is that if you have any text selected in a message when you run that script, then the original message will be deleted, and your 'copied' message will only contain the selected text.

I just found this out after searching for a message I had saved, only to find that when I had run the script I had only few characters selected.
bulbous
Drop-in Visitor
 
Posts: 7
Joined: Mon Apr 10, 2006 3:51 pm

Postby Michael » Wed Jun 28, 2006 1:21 pm

Another method, without using a script but not to my knowledge assignable to a button would be to create filters in one of the manual filter groups and then invoke them using the appropriate keyboard shortcut.
Michael
Moderator
 
Posts: 866
Joined: Mon Jul 26, 2004 12:14 pm
Location: Victoria BC, Canada


Return to PocoScript Help and How-To

Who is online

Users browsing this forum: No registered users and 2 guests

cron