Pages: 1
RSS
Need Help Creating a Filter, please
 
I've read the Help Topics regarding Creating a Filter, and tried it several times. However I must have set it up incorrectly.

I'm trying to create a filter that will move files out of a folder when sent. Because of the Mail Parameters I'm using, for some reason the watch and Send action under "Execute these actions when event finishes" doesn't move the files after they are sent

So I tried to set up a Filter to move the files from the folder after they're sent.

In Sorting Office, under General Tab, I used: Subject contains txt. In Action I used Move to the Folder:
C:\\the path to the Sent Folder.
In Options: This filter is active.

In Scheduler, under "Execute these actions when event finishes", I selected this created Filter as a refilter action.

Yet, the files do not move to the Sent Folder after sending. They remain and recurrently send.

So I must have done something incorrectly. I tried this, under the Sorrting Office General Tab using Subject, Recipient and File.

I am trying hard to do this without asking for more help, but theBat! has so many features and it takes a bit to learn it. Some guidance at this point will be immensely appreciated. Thanks sooo much, again.  
 
Move to Folder action in Sorting Office will move a message to a specified folder defined in theBat, not to a physical folder.

If you need to move files from one physical folder to another, under "Execute these actions when event finishes" select "Start a program" - this program could be a .bat file that moves the files.
 
You want to move a file after it's been sent.
Create an outgoing filter.
Set the conditions to trigger on the proper messages.
Set two actions:
1) export the message. Set as name for the export file some_path\move.bat
export format plain text
template should be this two lines:
copy %subject  target-directory
delete %subject
Of course target-directory should be replaced by the actual target directory
The %subject parameter uses the fact that your schedule inserts the full path to your subject line
When the destination file exists: overwrite the existing file
2) the second action shoulde be:
Run external action: some_path\move.bat
__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
 
Thank you for your reply.
I really appreciate the help.
I've tried your suggestion, as I read it, but I must ask for clarification, please, because it hasn't yet moved the files.

I have created an outgoing filter.
I have set the condition I believe will trigger the action, that is, the files Subject line contains: .txt.
I have set Sorting Office action Export The Message and Export Message to file: C:\Documents and Settings\Sent\move.bat

You suggested some_path/move.bat so I have created move.bat which is a blank file, and placed it in a destination folder, is this correct?

The Template contains two lines:
copy %subject C:\Documents and Settings\Sent\move.bat
delete %subject

Is C:\Documents and Settings\Sent\move.bat, the traget directory? Or is it C:\Documents and Settings\Sent ?

Created the second action:
Run external action: C:\Documents and Settings\Sent\move.bat

Is this correct? Is the path the command line?

Thank you. I look forward to clarification.


 
The target is the path you want the file to be moved too, that would be the sent directory, I guess.

Yes, the file you create yourself will be blank. TB will enter the proper contents to the file.

Note that when you're using a path with spaces in it, you'll need to enclose the full command between quote marks. You're external command should therefore be:
"C:\Documents and Settings\Sent\move.bat"

and you're template should be:
copy "%subject" "C:\Documents and Settings\Sent\move.bat"
delete "%subject"
__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
 
Thank you for your clarification I appreciate it greatly. However, even though it does move the files after sending, it doesn't remove the files, and therefore they send over and over again when the Scheduler is recurring.

How can I set this up so the files are moved not copied to the destination folder? Or deleted after sending? Or even renamed after sending? Just so they won't keep sending over and over?

Thank you again. I will be grateful for any assistance.
 
Please copy and paste the export template as you're using it into a message on this forum and also copy and paste the latest version of the exported move.bat
__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
 
Thank you SO much for your prompt reply.

Here is the export template:

copy %subject"C:\Documents and Settings\Sent\move.bat"
delete %subject



Here is the info in the exported move.bat:
(I have changed the email addresses for this posting)

copy C:\Documents and Settings\Ouput\Alex@infostations.com.txt"C:\Documents and Settings\Sent\move.bat"
delete C:\Documents and Settings\Ouput\Alex@infostations.com.txt

copy C:\Documents and Settings\Output\Alex@place.net.txt"C:\Documents and Settings\Sent\move.bat"
delete C:\Documents and Settings\Output\Alex@place.net.txt

copy C:\Documents and Settings\Ouput\Alex@infostations.com.txt"C:\Documents and Settings\Sent\move.bat"
delete C:\Documents and Settings\Ouput\Alex@infostations.com.txt

copy C:\Documents and Settings\Output\Alex@place.net.txt"C:\Documents and Settings\Sent\move.bat"
delete C:\Documents and Settings\Output\Alex@place.net.txt

copy C:\Documents and Settings\Ouput\Alex@infostations.com.txt"C:\Documents and Settings\Sent\move.bat"
delete C:\Documents and Settings\Ouput\Alex@infostations.com.txt

copy C:\Documents and Settings\Output\Alex@place.net.txt"C:\Documents and Settings\Sent\move.bat"
delete C:\Documents and Settings\Output\Alex@place.net.txt
 
Ok, here's where you're going wrong.
Both the %Subject parts in the template should be enclosed between quotation marks not only your target path should be enclosed between quotation marks.
Between the closing quotation mark of the subject part and the opening quotation mark of the target sould be at least one space.

So your template spould be:

copy "%subject" "C:\Documents and Settings\Sent\move.bat"
delete "%subject"

Just like I posted in the fifth message of thios topic.
It's important with these kind of things that you place (or copy in this case) every dot and space on the right spot.

As your move.bat exists of multiple sets of instructions it's obvious that you didn't set the option
"When the destination file exists - Overwrite the existing file"
as I suggested in the third message, you went for the default "Append to the existing file"
Just to be clear, these options belong to export action.
__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
 
Thank you again for being so kind to try to help me solve this issue. And my apology for missing "every dot and space on the right spot". I originally had "Overwrite the existing file", but in my frustration over the last few days, I changed it just to try something that might work.

Currently, the files are still not removed from the Output folder, yet the files are sent again and again.

However, now the move.bat file does not show:

copy C:\Documents and Settings\Ouput\Alex@infos­tations.com.txt"C:\Docume­nts and Settings\Sent\move.bat"
delete C:\Documents and Settings\Ouput\Alex@infos­tations.com.txt

copy C:\Documents and Settings\Output\Alex@plac­e.net.txt"C:\Documents and Settings\Sent\move.bat"
delete C:\Documents and Settings\Output\Alex@plac­e.net.txt

copy C:\Documents and Settings\Ouput\Alex@infos­tations.com.txt"C:\Docume­nts and Settings\Sent\move.bat"
delete C:\Documents and Settings\Ouput\Alex@infos­tations.com.txt

Over and Over, it now shows only one process and then is replaced by the next, here is an example of what now appears in move.bat:

copy "C:\Documents and Settings\Output\Alex@infostations.com.txt" "C:\Documents and Settings\Sent\move.bat"
delete "C:\Documents and Settings\Output\Alex@infostations.com.txt"

The template now looks like this:

copy "%subject" "C:\Documents and Settings\Sent\move.bat"
delete "%subject"

So, I am still hoping the files in the Output folder, once sent, can be removed, moved, deleted or renamed.

Thank you again. Any help will be great.
 
Oops! My fault.
Change the template into

copy "%subject" "C:\Documents and Settings\Sent"
delete "%subject"

In my second message I've been to eager to copy your text ('Lazy' is my middle name), so we tried to copy the file on top of the move.bat file and that's bound to cause problems.
__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
 
Thank you for your reply and modification. I gratefully appreciate your efforts.

copy "%subject" "C:\Documents and Settings\Sent"
delete "%subject"

However, I am sorry to report that the files in the Output folder remain, and are sending over and over, as per the Scheduler action. They are not being removed, unfortunately, upon being sent. The Sent folder shows copy after copy of the sent files.

So, I am still hoping the files in the Output folder, once sent, can be removed, moved, deleted or renamed.

Thank you again. Any help will greatly be appreciated.
 
Change the 'delete' into 'del'  
__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
 
YES!! It works!! Thank you SOOO MUCH!

You are so kind, thoughtful, very patient and brilliant!

I am very, very grateful for your assitance.
Much thanks.
 
Hi,

Regarding the creating of a filter with:

copy "%subject" "C:\Documents and Settings\Sent"
delete "%subject"

It works great, however, the subject line of each mail is the path to the file.

Is there a way to keep this working as great as it does, but somehow change the subject line of the email to something more interesting than the file path?

When I tested this, by changing S="%%i"; in the Command File to S="Hello"; the email was sent with the attachment and the new subject line "Hello", but the file remained in the Output folder, but a copy went to the Sent folder.

So my question is, how can I keep all the great functionality that was created here at this forum, (which includes moving the file from the folder after it's been sent) and change the subject line to something other than the file path.

Thank you.
I look forward to any possible suggestions/solutions.
 
Well, you found out how to change the subject line. Another way to change the subject line is by adding this macro to your sendfile.tpl:
%Subject="This is my new subject."
and forget the S= parameter completely in your sendfile.cmd

When you don't put the filepath in the subject line, apparently you need something else to get filepath\filename in your move.bat
The filepath part is easy, as you know that that's the same every time you use this construction, so the only thing you need to find out is the filename. And you know your filename, that's the name of your attachment.
Until here you could have deduced that by yourself and a simple checking of TB's help file would have told you that the %Attachments macro gives you that name.
So you substitute the two "%Subject" parts in your move.bat with "C:\Documents and Settings\Ouput\%Attachments" and you're done.

__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
 
Thank you again so much for your expertise. You are remarkable. TheBat! is remarkable. Much thanks.
Pages: 1