Hi, this is possible on Bridge on these conditions:
- you have a computer free just to do that, with no user intervation;
- you have Bridge allways active and on focus on the watch folder;
- be sure the system has no sleep mode active;
The base code you need is in here and you just need to add your code where is indicated.
Select a folder on your network to be the "hotFolder" (you can change its name and in the code itself);
On the computer that will be the listener over the hotFolder, just put this code on the Bridge "Startup Scripts" folder and reopen Bridge
Using another computer, put some images in the folder "hotFolder" and check is the listener event handler reacts automatically.
You can then add your code in the lines (see line 25) or use the file as an argument to run other code you want;
In the end, after the file was processed, just move it or remove it;
This listener will be triggered anytime a file is added or removed or the cache is refreshed. It works only on a folder called "hotFolder";
Hope it helps,
More info in here:
https://forums.adobe.com/thread/2278787
Code: Select all
var listenerHotFolder = function( event ) {
// IMPORTANT: $.hiresTimer > 180000 this will make sure to trigger only once on cached folders like the hot folder, because when a file is detected it trigers twice (start building cache and finishing building cache).
if ( event.object instanceof Document && event.type == 'loaded' && $.hiresTimer > 180000) {
// only works if the active folder name is "hotFolder" case sensitive
if (app.document.thumbnail.name.toLowerCase() == "hotfolder") {
var myFiles_array = [];
// if doesn't exist, creates a subfolder to move the active processing files
var processingFolder = Folder(app.document.presentationPath + "\\processing");
if (!processingFolder.exists) processingFolder.create();
// You can change the image kind you want to deal with, or other file kind
var items = Folder(app.document.presentationPath).getFiles( function(f) { return (f instanceof File && f.name.toLowerCase().match(/\.dng|cr2|jpe?g$/) != null);}); // JPG | CR2 | DNG
for (var a=0 ; a < items.length ; a++) {
var copied = File(decodeURI(items[a])).copy( File(File(decodeURI(items[a])).path + "/processing/" + File(decodeURI(items[a])).name ) );
if (copied) {
$.writeln(File(File(decodeURI(items[a])).path + "/processing/" + File(decodeURI(items[a])).name ).fsName)
myFiles_array.push(File(File(decodeURI(items[a])).path + "/processing/" + File(decodeURI(items[a])).name ).fsName);
File(decodeURI(items[a])).remove();
}
}
app.document.thumbnail.refresh();
// if files were dropped on the hotFolder, and were collected, any script can be running on each file.
if (myFiles_array.length > 0) {
for (var a=0 ; a < myFiles_array.length ; a++) {
// here you can put your code
// this is just an exemple to test (you can delete this later:
alert("Processing the File:\n" + File(decodeURI(myFiles_array[a])).name);
}
}
}
//
return {
// FALSE + block last path repetition »» só repete o evento numa numa pasta (não repete em F5 ou em cache rebuild) Resumo: sá actua se navegar numa nova pasta
// TRUE + block last path repetition »» repete em várias situações: numa nova pasta, ao criar/apagar ficheiros/pastas no folder activo, ao reordenar a primeira vez (qd cria a primeira vez o file invisivel .bridgesort)
handled:true
}
}
}
app.eventHandlers.push( {handler: listenerHotFolder} );