Forum

Share

Please consider registering
guest

Log In RegisterMembers
Or log in with

Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Run File only runs for the first mail?
December 9, 2009
3:41 am
Andreas
Guest

Hi, thanks for this great extension! I set up a filter which lauches a bat file which pipes it to a python script. This works great, but I have to run it for every match in a folder.

For example, I would like to run the bat with ervery mail which matches a specific topic. Lets say I would like to match all emails from ebay – do some regex and save the end-date of the auction to my (Google) calendar. Running it for every mail that comes in is cool, but processing (all) already received mails (at least as an option) would be also great. Is there a way to do it?

bye bye

Andreas

Share
December 9, 2009
9:50 am
Admin
Forum Posts: 323
Member Since:
July 12, 2008
Offline

We are somewhat limited by the way that filters are applied in the core code. Although the calls to perform a custom action are given a list of messages rather than a single message, in most cases in core the call to actions is actually made one message at a time. But there is an exception, and that is in the new "after classification" context (or the closely-related cases where filters are applied manually).

There is also a difference in the FiltaQuilla Run and Launch actions. Launch is called once per batch, Run is called per message. So I think (but have not tested) that if you try to apply the Launch command with the "after classification" context, it will only get called once per batch.

But there is no way to get any information about the message to the external program in Launch at the moment. But if you are a programmer, you could perhaps look at the implementation of Launch and Run in the extension code, and adapt it for your needs.

Share
December 9, 2009
6:02 pm
Andreas
Guest

Thanks for the reply, I played a litte bit with your code (I never did any Mozilla development before). I found two ways to achive my goal :)

1) when I pull up the for-loop which loops over the messages to the top of self.runFile it will create a new process for every message – my *.bat File gets called with the updated parameters  and does what I want. But creating a new process for ervery message "feels" wrong…

2) If I set the "blocking" in theProcess.run(); to true, it calls the batch file for every message with the updated params after the previous process finished. I think I will use this way and add a new Filter Methode "Run File (blocking)" to the Extension.

thanks again,

Andreas

Share
Forum Timezone: UTC -8

Most Users Ever Online: 18

Currently Online:
9 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

bobkatz: 8

BigMike: 8

t2m: 7

zabolyx: 7

taa: 6

onlyme: 6

Member Stats:

Guest Posters: 130

Members: 565

Moderators: 1

Admins: 1

Forum Stats:

Groups: 1

Forums: 7

Topics: 231

Posts: 802

Moderators: rkent (323)

Administrators: rkent (323)