WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
   
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
how to email task to give status of another task? (Read 2524 times)
ericb1
YaBB Newbies
*
Offline



Posts: 14
how to email task to give status of another task?
Jul 13th, 2010 at 11:48pm
 
not sure if this can be done, any help is greatly appreciated.

using latest version, I have a print task to print all pdf's in a directory, using the foxit reader.  This works great.  The directory has a large number of pdf's, sometimes over 100 documents.

I would like to be able to send an email on this task to show:

Task "printer" has started at 8:00 AM, and finished at 9:00 AM.  It sent 100 PDF's to the printer named "printer" and the documents are:

document 1
document 2
document 3
document 4

etc.

It seems like all this information is in the wdNotify tray window when I open it.  It begins with the event trigger, and ends with the QUIT line.  So, pretty much everything in there I would like to be able to format and email.

Is this possible?  Any help is greatly appreciated, thanks!
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2238
The Netherlands
Re: how to email task to give status of another ta
Reply #1 - Jul 14th, 2010 at 5:02am
 
Hello Eric,

Not directly, but with a work-around this is possible.
Below I assume your print-pdf task is called PRINTPDF (change accordingly).

Create a new directory somewhere on a local drive (not on the network), for example
C:\Data\PrintPdf

In the WD Control Center select the menu option
Tools -> Explore Task Directory
This will open Windows Explorer inside the directory where WD stores its settings. Now navigate to the sub-directory with the same name as your task (PRINTPDF). Inside this directory you will find a file called [b]wd.bat[/b] - this is the script launched by WatchDirectory to print the PDFs.

Open the script in notepad.
Near the end of the file you see this line
[code]"%FOXCMD%" %OPTIONS% "%WD_FILE%" "%PRINTER%"
[/code]
Change it to
[code]ECHO "%TIME% Start Print %WD_FILE%" >> "C:\data\PrintPdf\%WD_FILE_B%.txt"
"%FOXCMD%" %OPTIONS% "%WD_FILE%" "%PRINTER%"
ECHO "%TIME% End Print %WD_FILE%" >> "C:\data\PrintPdf\%WD_FILE_B%.txt"
[/code]
Make sure to use the correct directory (C:\data\PrintPdf - the new directory you created above).

Now create a new task using the Email plugin ( http://www.watchdirectory.net/wdhelp/plugins/wdopAutoEmail.html ) that monitors the directory C:\Data\PrintPdf for new and changed files (FILENEW and FILECHNG, see http://www.watchdirectory.net/wdhelp/help/wdnewconfigpage4.html ).
Configure the email task to attach the detected file and remove it after sending the message. Press the "Combine Emails" to prevent receiving an email for each individual printed pdf.

Should work fine, I think.
Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
ericb1
YaBB Newbies
*
Offline



Posts: 14
Re: how to email task to give status of another ta
Reply #2 - Jan 11th, 2011 at 4:03pm
 
Thanks for your help.

I've changed my PDF print script (thanks to your help) and now instead of using a PDF print job, I use a "Run any .bat file" job, to run the custom bat file you sent me.  The bat file prints the documents in a specific date/time order.

So I tried putting the "ECHO "%TIME% Start Print %WD_FILE%" >> "C:\data\PrintPdf\%WD_FILE_B%.txt" into the bat file that is printing the documents, but that doesn't work.

Should I try putting these lines into the wd.bat script of the job itself?

Any help is greatly appreciated, thanks!
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2238
The Netherlands
Re: how to email task to give status of another ta
Reply #3 - Jan 12th, 2011 at 8:10am
 
Can you rename your script to TXT and email it to me so I can have a look? The ECHO statement you mention looks ok to me
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Page Index Toggle Pages: 1