Ive tried apps like Total Folder Monitor to do these things for me but each one has its issues or faults or just doesnt work so Ive resorted to bat files and hope I can find an answer here.
Requested Outcome:
New jpg is added to folder via dropbox
bat file realizes new item is there
bat file runs a command prompt which runs a photoshop droplet against the new file eg:
command I need run in cmd prompt window would be similar to c:\droplet_path\droplet.exe "c:\monitored_folder\new_item.jpg" (new_item.jpg would be randomly named from camera to be something more like 2013-01-01 15.22.14.jpg)
what this does then is opens photoshop, runs an action against the new image that appeared in the folder and saves it somewhere else
I then want the bat file to delete the original jpg that the camera took that was in the dropbox folder c:\monitored_folder\2013-01-01 15.22.14.jpg which leaves me only with the new item that photoshop has saved into a different location
does this make sense?
I'm assuming it's pretty straight forward but the things I have tried up to this point are just pissing me off now haha.
-Dave
[SOLVED] bat file to monitor folder contents
Moderator: DosItHelp
[SOLVED] bat file to monitor folder contents
Last edited by Andrius on 13 Jan 2013 21:14, edited 1 time in total.
Re: bat file to monitor folder contents
This should (untested) run the droplet on each JPG file in the "c:\monitored_folder\" and after ~20 seconds delete the JPG file and the process the next JPG file.
When all JPG files are don it then waits for ~60 seconds and does it all again.
The 20 second ping delay may not be needed if the droplet doesn't continue until photoshop has done it's bit, but just in case...
When all JPG files are don it then waits for ~60 seconds and does it all again.
The 20 second ping delay may not be needed if the droplet doesn't continue until photoshop has done it's bit, but just in case...
Code: Select all
@echo off
:loop
if exist "c:\monitored_folder\*.jpg" (
for %%a in ("c:\monitored_folder\*.jpg") do (
start "" /w "c:\droplet_path\droplet.exe" "%%a"
ping -n 20 localhost >nul
del "%%a"
)
)
ping -n 60 localhost >nul
goto :loop
Re: bat file to monitor folder contents
testing now. Thank you so much for taking the time to help me BTW
Last edited by Andrius on 13 Jan 2013 21:08, edited 1 time in total.
Re: bat file to monitor folder contents
Works like a hot damn! I will share this little tidbit with the photography community! Thank you!!!!!!!!!!!!
Re: [SOLVED] bat file to monitor folder contents
Glad to be of service. Thanks for the feedback.