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
Monitoring multiple folders for PS to PDF (Read 1403 times)
David
YaBB Newbies
*
Offline



Posts: 1
Monitoring multiple folders for PS to PDF
Sep 5th, 2014 at 5:12am
 
Hi,
I am evaluating the Convert Postscript Files to PDF task in WatchDirectory as an alternative to Adobe Distiller.

I need to watch 60 folders under the same parent folder each with an "in" and "out" subfolder.
e.g.
                6678
                  |
                  |--- in
                  |--- out
       6681
         |
         |--- in
         |--- out
       6693
         |
        …

Whenever a PS file appears in the "in" folder it needs to be processed and the generated PDF file needs to be dumped in the corresponding "out" folder.  i.e. PS file dumped in \6678\in creates a PDF in \6678\out.  The names of the PS files that are created in the "in" folder are not uniquely named i.e. I cannot readily identify which "numbered" folder e.g. 6678 they belong to.

Hence, I have set up a separate task within WatchDirectory for each of the different numbered folders to monitor each "in" folder separately.

Testing has revealed that the application does not handle concurrency very well.  For example if I place a PS file in 2 different "in" folders at the same time WatchDirectory will sometimes generate the contents of the PS file and place the PDF into a different “out” folder. E.g. PS file dumped in \6678\in and contents of PDF generated in \6681\out - not good.

I think this is a consequence of setting up 60 different tasks that are running in conjunction with one another.

My question is, is there anyway I can set up WatchDirectory to monitor my 60 “in” folders located in different numbered folders so that it will generate the PDF’s and place them in the correct “out” folder all under One Task in watchDirectory?  I think this may overcome my problem.

Thanks,
David
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2233
The Netherlands
Re: Monitoring multiple folders for PS to PDF
Reply #1 - Sep 5th, 2014 at 10:37am
 
Hello David,

You should be able to create one task that also monitors sub-directories to do that.

Create the task (below I assume you call the task CONVPDF), enter something for the TARGETDIR (it will be ignored).
Before you run the task, do this:
- In the WD Control Center, select the menu option "Tools -> Explore task directory", this opens Windows Explorer, typically inside C:\ProgramData\WatchDirectory
- navigate to the subdirectory with the name of the task you just created (CONVPDF).
- open the wd.bat file you will find there with notepad

Now search for the lines
Code:
$$$
:StartOfBat
 


and immediately after it, enter a new line of code so it becomes
Code:
$$$
:StartOfBat
SET TARGETDIR=%WD_FILE_D%..\out
 



%WD_FILE_D% is a variable containing the name of the directory where your PS is found (the "in" directory), so appending ..\out to it will point to the correct directory. Also see http://www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBatEnv.html
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